Skip to main content
Solved

EntitlementInfo `isActive` returns true even if subscription has expired


Forum|alt.badge.img+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

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. 

View original
Did this post help you find an answer to your question?

2 replies

Forum|alt.badge.img+3
  • Author
  • New Member
  • 1 reply
  • October 8, 2022

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`

 

Example:

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` ?


Miguel Carranza
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 84 replies
  • Answer
  • October 17, 2022

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. 


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