Question

Entitlements appearing as active even though they are not

  • 19 April 2023
  • 2 replies
  • 26 views

Badge +3

This piece of Swift code

Purchases.shared.getCustomerInfo { [weak self] info, error in    guard let info = info, error == nil else { return }    if info.entitlements["monthly_access"]?.isActive == true {

Is always returning isActive == true, even though the entitlement has expired.

Since I have the original app user ID, I checked with the v1 API and this is what I get:

{'request_date': '2023-04-19T09:03:03Z', 'request_date_ms': 1681894983925, 'subscriber': {'entitlements': {'monthly_access': {'expires_date': '2023-04-18T11:14:37Z', 'grace_period_expires_date': None, 'product_identifier': 'subscription_basic', 'purchase_date': '2023-03-18T11:14:37Z'}}, …

As you can see the monthly_access exists but its expiration date is older than the current date so I would not expect this to return isActive true

This is a big issue because it allows people to access the app even though they are not paying (I would say very essential feature of the SDK is to prevent people from accessing features they are not paying for)

Any help on this? I am losing money so it is quite urgent.


2 replies

Badge +3

Update on this… eventually isActive became false

It seems the value was cached somehow for a very long time… actually, I believe it did not refreshed until the app was closed and reopened (the user I know this from tried to access around 22 later than expiration date and isActive was true)

Userlevel 4
Badge +8

Hi, what you are seeing is expected behavior because of the cache. We update when we can and usually when the cache is older than 5 minutes, but we might not refresh it in certain cases like if there's no network connection.

Reply