Closed hellbit closed 4 years ago
There is sometime a lag between StoreKit updating renewals and the actual state of subscriptions. MerchantKit offers a grace period to avoid these issues and prevents users being told they need to pay, when they are actually paying. The info
represents the last known value, which is why it will sometimes be out of sync. You should only use isPurchased
to determine whether to give access to the user's product.
If you want to, you can customize the duration of the grace period by providing a custom configuration, but I wouldn't recommend it.
My canceled subscriptions returning as isPurcahsed true up to 1 months delay. What can I do about it?
As explained above, you can supply a custom configuration to the Merchant(...)
initialiser, which customises the timeout via the subscriptionRenewalLeeway
on the LocalReceiptValidator
. However, I don't recommend it as it penalises legitimate users.
subscriptionRenewalLeeway is which value in default configuration?
When I check the state of the subscription it returns
case .isPurchased(_):
But my subscription was expired and I don't have any subscriptions right now.The question is: Do I need to check the
info.expiryDate
fromcase .isPurchased(_):
? I am asking it because I see this one in the code -Note: Do not use this value to decide whether to allow access to the product.
And another question is: why do I see two different dates? From iTunes I see 11 Jul 2020 but
info.expiryDate
is equal 2020-06-26 10:39:48 +0000This's my code:
Thank you