đ¸In-App Purchases
Before reading this page, please make sure you've set up your RevenueCat account.
đSetup RevenueCat AppTo offer a seamless purchasing experience across platforms, use In-app Purchases for your mobile app users and your preferred web payment processor for website users. The Browser Info feature helps you identify the user's platform to apply the correct payment method.
đ§ Bubble.io Plugin
[Element] Natively - Purchases
Events:
Purchase Success
Purchase Failed
Set Customer Success
Set Customer Failed
Purchase Cancelled
Customer ID Received
Get Price Success
Get Price Failed
Restore Purchase Success [iOS]
Restore Purchase Failed [iOS]
States:
Latest Transaction Id - Transaction Id after Purchase Package
Latest Customer Id - Customer Id after Set Customer ID or Purchase Package
Latest Error - Empty if no error
Latest GetPrice price - 9.99
Latest GetPrice price (Localized) - "$9.99" / "9.99 USD"
Latest GetPrice currency - "USD", "UAH", etc.
Latest PurchasePackage packageId
Actions:
Purchase Package - Initiate purchase of product or subscription
Set Customer ID - Link your user's id with RevenueCat customer
Customer Identifier - (We're recommending using a Current User's unique id to identify customers in the RevenueCat dashboard)
Reset Customer ID - Unlink Customer ID from a device
Get Package Price - Returns a price for specific product
Get Customer ID - Returns a current customer id
Restore Purchase [iOS] - Restores purchases (Handled by RevenueCat automatically)
How to use?
Make sure you've set up your Revenue Cat for your app
Add revenuecat_apiKey in plugin settings. To find API Key, go to RevenueCat App > API keys > Secret API keys.
Call Set Customer ID
Call Purchase Package action
How to verify User's subscription?
Make sure you've added revenuecat_apiKey in plugin settings. To find API Key, go to RevenueCat App > API keys > Secret API keys. â ī¸â ī¸â ī¸ MAKE SURE YOU'RE USING API KEY V1
RevenueCat - Verify Subscription
Customer ID - Revenue cat user id that was used on RevenueCat Login.
A new customer will be created if the customer with such ID does not exist. More details here
Entitlements ID - your entitlements id, more details here.
Returns a result as:
Product ID - text
Purchase Date - date
Grace Period Expires Date - date
Expiration Date - date
Is Active - yes / no (Expiration Date > Current Date)
Error - empty text if no error
Bubble Setup example:
On each User Login or first Signup you need to set the RevenueCat customer ID to your own user's unique id.
Purchase a subscription (package) with action
Verify user's subscription whenever you need it
If you have any issues and, for some reasons, purchases doesn't work. You can check Latest Error value from Natively Purchases element
You can also use RevenueCat API for your purpose (for example, validation of purchases)
đ JavaScript SDK
NativelyPurchases
How to verify subscription with JS?
You need to fetch a user from RevenueCat API and verify it's entitlements. More details can be found here.
Where to find Package ID?
You can find it in your RevenueCat App dashboard, more details here
For custom package identifier
For default package identifier
How to link Stripe & RevenueCat?
We recommend checking this guide if you plan to use a Stripe subscription through RevenueCat.
How to link Stripe purchases with RevenueCat?
Create a request in API Connector (more details about the endpoint you can find here)
Where fetch_token & app_user_id is:
Last updated