Skip to main content

I am a little lost here and could use some pointers/help.  I have a Flutter application which has Ads in it. I have no concept of a “user” in my app. I would like to add the ability to remove Ads. I created all the required store setup for both Google and Android.  I’ve added a button in my app to purchase the product I setup (I have only the one product) to remove Ads.  This all works as expected on both Android and iOS.  

 

I need to implement the “restore” capability in my app per the Apple App Store requirements.  I have questions as I can’t seem to figure out exactly how to do this.

  1. Since I use anonymous accounts wouldn’t the user, upon removal of the app and reinstallation get a new anonymous ID?  If so, how does the system know they already purchased my product?
  2. How is this done typically, should I show both a Purchase and a Restore option in the app?  Seems like there should be a way to ‘detect’ that the user already made a purchase and if so provide the ‘restore’ option...and if not then provide the ‘purchase’ option.
  3. From the docs Restoring Purchases (revenuecat.com) it appears I just call the following, then check to see if the entitlement isActive, is that correct?

CustomerInfo customerInfo = await Purchases.restorePurchases();

 

 

 

Is it as simple as calling that API and that’s all?  On Android I believe that when I tried calling the purchase API it knew that the user already had bought and asked if they wanted to restore their purchase. Maybe that was iOS?? I’ve done so much testing the last few days it’s a blur 🙂 Just need to get this last requirement done to get the update in the iOS store. Can anyone help?


Hi,

  1. Since I use anonymous accounts wouldn’t the user, upon removal of the app and reinstallation get a new anonymous ID?  If so, how does the system know they already purchased my product?

Yes, that is correct. If you are not configuring with a custom id, then an anonymous id will be assigned to the user. And if the user deletes and reinstalls the app, this will generate a new anonymous id for them. Upon calling restore purchases, the underlying store account being used will be checked to see if purchases were made for your app, and if there were then access to those will be restored.

 

  1. How is this done typically, should I show both a Purchase and a Restore option in the app?  Seems like there should be a way to ‘detect’ that the user already made a purchase and if so provide the ‘restore’ option...and if not then provide the ‘purchase’ option.

You can provide both buttons. Our API does not have a way to identify the underlying store account of the user, but if they try to repurchase the same product they already own, the underlying store will automatically restore purchases.

Another thing you could do is call syncPurchases() after configure() to automatically do this for users. Then you can check their CustomerInfo object to see if they have purchases and choose to display buttons accordingly.

https://www.revenuecat.com/docs/customer-info

https://www.revenuecat.com/docs/restoring-purchases#syncing-purchases-without-user-interaction

 

  1. From the docs Restoring Purchases (revenuecat.com) it appears I just call the following, then check to see if the entitlement isActive, is that correct?

CustomerInfo customerInfo = await Purchases.restorePurchases();

Yes, you’ll want to call Purchases.restorePurchases() after the user presses the ‘Restore Purchases’ button. Then you can check the user’s CustomerInfo for the entitlement.

 


Hi Team,

I am trying to implement Restore Purchase in my app in Flutter Flow, I implemented the below in my app:

Restore Purchase -> Check PayWall for Entitlement -> Display on App

 

I tried testing it on Test flight but it apparently doesn't work, as nothing is returned in Test Mode.

 

Can you please explain what does the Restore Purchase send back upon a call in FlutterFlow?

 

I am a bit lost.

 


I believe the Restore purchase updates the customer info object.

All I do in my app is just Call the restore purchase method and then listen for changes in the entitlement. Nothing additional is required and I have not had any complaints so far from users.


Hi Joseph,

Thanks a lot for your reply. Do you mean that you have implemented something like what I have attached in the snapshot? If yes, what's happening is that when I click on purchase action related to RevCat, it says that "User has already subscribed to the service” but when I check Restore Purchase → then the PayWall method and check for entitlements, it returns nothing.

 

Can you please let me know, how are you doing this in FlutterFlow - " listen for changes in the entitlement”?

 


Oh no, I’m so sorry! I didn’t realize you were using Flutter Flow. I haven’t used that myself, so I’m not familiar with how it works. The example I gave was using the Flutter SDK.


Reply