When testing purchases on Sandbox with StoreKit config specifying a 30 second subscription interval I quite often get an entitlement that has equal latestPurchaseDate
and expirationDate
therefore rendering it invalid immediately and deadlocking my purchase flow.
Logica::Store::update_state: entitlements: ["base_content_access": <EntitlementInfo: "
identifier=base_content_access,
isActive=false,
willRenew=true,
periodType=PeriodType(rawValue: 1),
latestPurchaseDate=Optional(2022-05-21 13:58:39 +0000),
originalPurchaseDate=Optional(2022-05-21 13:58:39 +0000),
expirationDate=Optional(2022-05-21 13:58:39 +0000),
store=Store(rawValue: 0),
productIdentifier=fivesysdev.logica.renewable_subscription,
isSandbox=true,
unsubscribeDetectedAt=nil,
billingIssueDetectedAt=nil,
ownershipType=PurchaseOwnershipType(rawValue: 0)
>]
Sometimes happen for 5 minute intervals too, but significantly less often. I was fine with this but Apple rejected my app, most probably due to them testing my app on sandbox with low intervals too.
I worked around this by detecting sandbox and equal latestPurchaseDate
and expirationDate
and then treating it as false negative by acting like entitlement is active, but this seems like a bug.