Skip to main content
Solved

How to prevent multiple purchases?

  • February 4, 2022
  • 3 replies
  • 354 views

Forum|alt.badge.img+4

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.

View original
Did this post help you find an answer to your question?

cody
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • February 4, 2022

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.


Forum|alt.badge.img+6
  • Dedicated Member
  • March 7, 2022

Hi @cody 

I have a similar problem; how do you avoid this if the customer uninstalls/installs ?

The entitlement would be inactive so the user would purchase again.

Is the only way round this as described in the original question?

RevenueCat/iOS handles this, why doesn’t RevenueCat/Android?  I had originally implemented Android In App Billing and that handled this scenario.

regards

Peter


Michal Pawlik
Forum|alt.badge.img+2

Hey @cody 

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?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings