Skip to main content
Question

Purchases.restorePurchases() not working for promo entitlements on Android


Forum|alt.badge.img

Hello,

The steps I perform:
1. Create a new user (the user appears in RevenueCat Dashboard).
2. Grant entitlement to the user in the Dashboard.
3. Run Purchases.restorePurchases() in the app (Flutter)
4. Then Purchases.getCustomerInfo()

The steps work perfectly in iOS: the customer info contains the entitlement.
They doesn’t work on Android though. restorePurchase does not seem to account for the promo account given in the Dashboard:
 

D/[Purchases] - DEBUG( 5926): ℹ️ Restoring purchases
W/[Purchases] - WARN( 5926): ⚠️ allowSharingPlayStoreAccount is set to false and restorePurchases has been called. This will 'alias' any app user id's sharing the same receipt. Are you sure you want to do this? More info here: https://errors.rev.cat/allowsSharingPlayStoreAccount
D/[Purchases] - DEBUG( 5926): ℹ️ Querying purchase history for type subs
E/libEGL  ( 5926): called unimplemented OpenGL ES API
D/EGL_emulation( 5926): app_time_stats: avg=1898.39ms min=4.90ms max=16965.74ms count=9
D/[Purchases] - DEBUG( 5926): ℹ️ Purchase history is empty.
D/[Purchases] - DEBUG( 5926): ℹ️ Querying purchase history for type inapp
D/[Purchases] - DEBUG( 5926): ℹ️ Purchase history is empty.
D/[Purchases] - DEBUG( 5926): Retrieving customer info with policy: CACHED_OR_FETCHED
D/[Purchases] - DEBUG( 5926): ℹ️ Vending CustomerInfo from cache.
D/[Purchases] - DEBUG( 5926): ℹ️ Checking if cache is stale AppInBackground false
D/[Purchases] - DEBUG( 5926): Retrieving customer info with policy: CACHED_OR_FETCHED
D/[Purchases] - DEBUG( 5926): ℹ️ Vending CustomerInfo from cache.
D/[Purchases] - DEBUG( 5926): ℹ️ Checking if cache is stale AppInBackground false


purchases_flutter: 8.8.1
purchases_ui_flutter: 8.8.1
Android SDK: 35

The behaviour is the same in the emulator and in a real device.

Is this expected?

Thanks.

3 replies

chris_perriam
RevenueCat Staff
Forum|alt.badge.img+3

Hi ​@yuri-47921c , you’re correct to believe the entitlement should be present regardless of the platform. To check whether this is a caching issue, could you please try calling invalidateCustomerInfoCache  prior to getCustomerInfo? Let me know whether that gives the expected result


Forum|alt.badge.img
  • Author
  • New Member
  • 4 replies
  • May 26, 2025

@chris_perriam Thank you. I confirm invalidateCustomerInfoCache helps. Shouldn’t it be a part of restorePurchases though?


chris_perriam
RevenueCat Staff
Forum|alt.badge.img+3

@yuri-47921c Restoring purchases reactivates previously purchased content from the same store account, as it takes the platform's underlying receipt and checks for purchases.

The RevenueCat SDK keeps a cache of CustomerInfo and periodically refreshes this cache with the latest available information from RevenueCat’s servers. The logic we use for updating the cache is documented here: https://www.revenuecat.com/docs/test-and-launch/debugging/caching#customerinfo

Depending how much time has passed since the last cache update, restorePurchases may not cause new information to be fetched from RevenueCat’s servers. However, the cache will be invalidated if invalidateCustomerInfoCache is called, or your app is quit and reopened.

While it won’t change how frequently the cache is updated, I do recommend listening for customerInfo updates to ensure that your app can respond quickly to any change in the user’s entitlements.

Hope this helps! Let me know if I can clarify anything further.


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