I am using revenuecat in my product. Currently, I already setup the “Offerings” as “Lifetime”.
My expectation is that if I call method: Purchases.purchasePackage(package) multiple times, then there is only one time purchase.
But, each time I call above method, I still can buy a new IAP.
What should I do to prevent that ?
Currently, I have to try to “restore purchase” and check, if restore failed => buy new purchase.
Best answer by cody
Hey @imuos!
The RevenueCat SDK itself won’t prevent you from making multiple purchases on Android if you keep calling the purchasePackage method, so you’ll need to check if a user has an active purchase first before showing the paywall/allowing the user to start the purchase.
If your lifetime product should only be purchased once, you should attach it to an entitlement, then check if an entitlement is active before allowing the customer to make that purchase.
The RevenueCat SDK itself won’t prevent you from making multiple purchases on Android if you keep calling the purchasePackage method, so you’ll need to check if a user has an active purchase first before showing the paywall/allowing the user to start the purchase.
If your lifetime product should only be purchased once, you should attach it to an entitlement, then check if an entitlement is active before allowing the customer to make that purchase.
I just switched from official plugin for in-apps - https://pub.dev/packages/in_app_purchase and with it the plugin was preventing users from purchasing the same product on Android.
Can’t it be a default behaviour with RevenueCat as well?
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.