Solved

How to prevent multiple purchases?

  • 4 February 2022
  • 3 replies
  • 219 views

Badge +3

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.

 

 

icon

Best answer by cody 4 February 2022, 22:10

View original

3 replies

Userlevel 6
Badge +8

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.

Userlevel 1
Badge +5

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

Badge +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