Question

Receiving "Active" Entitlement ONCE after Expiration every time, disappears upon next reload

  • 27 March 2024
  • 1 reply
  • 12 views

Badge

Hi, sorry if the title is confusing, hard to explain in one line. I am using the React Native SDK and testing on an iOS device in sandbox.

The problem I’m having is that Purchases.getCustomerInfo() seems to be returning an expired entitlement in the active list on the first app run after it’s expired. On all subsequent runs, it disappears as expected because it’s expired. But it means the app thinks the user still has an active entitlement for that first run when they should not.

To try and explain the steps to reproduce:

  1. User purchases a subscription, which activates the entitlement.
  2. User uses the app during the subscription and all works as expected.
  3. User closes the app.
  4. Subscription expires (dashboard reports it is expired and entitlement is expired).
  5. User opens the app, which fetches customerInfo.
  6. The entitlement still comes back in customerInfo.entitlements.active at this time.
  7. User reloads the app or closes and reopens, which refetches customerInfo.
  8. The entitlement is no longer in customerInfo.entitlements.active.

This is 100% reproducible. It appears in active on the first fetch after it has expired.

I’m considering not treating the active list as accurate and additionally looking at expirationDate to ensure we’re not past the expiration date, but that seems a little counterintuitive since the list should be reliably accurate.

 

Please let me know if I’m misunderstanding or if this is a known bug, thank you!


This post has been closed for comments

1 reply

Userlevel 4
Badge +8

Hi, it sounds like the customerInfo is caching here. To force this to refresh, you can use our invalidateCustomerInfoCache() to force the SDK to fetch the data again.  I haven’t heard any other reports of this lately, it could be related to the sandbox environment. Can you let me know if you are also experiencing this in production?