EntitlementInfo `isActive` returns true even if subscription has expired

  • 8 October 2022
  • 2 replies

Badge +3

As shown in the image, the time that I captured the photos has already passed the `expireationDate`

However the `isActive` still returns true 

Can somebody help?


I’m using Xcode 14 Beta 3, iOS 16.1, latest version of RevenueCat


Best answer by Miguel Carranza 18 October 2022, 01:07

View original

2 replies

Badge +3

Ok it seems like it’s a problem with this line: EntitlementInfo.swift L218

The `requestDate` passed to the function isn’t the current date when client calls `Purchases.shared.getCustomerInfo`



Expires at: 2022-10-08 00:05 

Call the method `Purchases.shared.getCustomerInfo` at: 2022-10-08 00:06

The `requestDate` passed to the function might be `2022-10-08 00:03 `


This is why sometimes it returns true even if it already expires.

I’m wondering why the SDK was designed this way, I thought you should always compare the current date i.e: Date() with the `expireDate` ?

Userlevel 2
Badge +6

This is done to be able to support quick checking when the device is offline. If the entitlement was active last time we successfully checked and it’s cached, we grant the entitlement. Then it’s checked with the right date. We’d rather unlock something that will be locked in a moment, than showing something locked to somebody that has paid.