In App Purchases
Last updated
Last updated
🚨🚨 Important Step 🚨🚨
See instructions in Expo Dev Client
In-app-purchases will not work in Expo Go
In config.ts
, set requireSubscription: true
This will automatically popup the paywall the first time the user opens the app
Comment out this line
export const RevenueCatProvider = MockRevenueCatProvider
Uncomment the entire RevenueCatProvider
component below that
Setup the product in App Store or Play Store
Create the subscription or in-app-purchase in App Store Connect
For in-app-purchases, the instructions are similar to the link above, just click the "in-app-putchase" tab instead
Import the product into RevenueCat
Create an entitlement in RevenueCat for your product
Attach your product to the entitlement
Create an offering in RevenueCat for your entitlement
Add a package to the offering
Add your product to the package
Fetch your API keys from RevenueCat
It can be found under App > Project Settings > API Keys
Add the API keys under config.ts
under the revenueCat field
in RevenueCatProvider.tsx
Set the variable PACKAGE_ID to the package id you setup. This can be found under the offering tab in RevenueCat (ex. $rc_lifetime
)
Set the variable ENTITLEMENT_ID to the entitlement id you setup. This can be found under the entitlement tab in RevenueCat
Now, you can launch the paywall
Make sure you're debugging using the EAS prebuild (see above). This will not work in the Expo mobile client
To reset the purchases, you need to reset it in BOTH App Store Connect and RevenueCat
Resetting in App Store Connect
On device
Go to settings > app store > sandbox account > manage > reset purchase history
In App Store Connect
Go to app store connect > users & access > sandbox > test accounts > edit > clear purchase history
Resetting in RevenueCat
Click the transaction, scroll to the bottom, press delete customer
Use the following hook to access app state
To check if the user has the entitlement, use
To automatically show the paywall screen if the user has not purchased the subscription
For subscriptions, see instructions here
See the section titled "RevenueCat Configuration"
See the section titled "Entitlements"
See the section "Offerings"
See detailed instructions
Go to recent transactions and find your transaction