Post

Replies

Boosts

Views

Activity

Reply to Is subscription autoRenewStatus in StoreKit2 working correctly with Sandbox testing?
This state miss-match appears to be a result of StoreKit2 cacheing subscription info in a local database at: ../app_container/Library/Caches/StoreKit/receipts.db. I was able to improve my flow by doing the following after displaying the manage subscriptions sheet. Clear the caches directory Fetch either the entitlement via Transaction.currentEntitlements or refresh a specific subscription group via Product.SubscriptionInfo.status(for:). Example cache clear: public func clearStoreKitReceiptsCache() throws { let fileManger = FileManager.default guard let cachesDir = fileManger.urls(for: .cachesDirectory, in: .userDomainMask).first else { return } guard let storeKitPath = try fileManger.contentsOfDirectory( at: cachesDir, includingPropertiesForKeys: nil, options: []).first(where: { $0.lastPathComponent == "StoreKit" }) else { return } try fileManger.removeItem(at: storeKitPath) }
Feb ’22
Reply to Is subscription autoRenewStatus in StoreKit2 working correctly with Sandbox testing?
+1 on this issue and I'm also seeing very erratic behavior on these status changes. Similarly, shouldn't a change in auto-renew status trigger a change via the subscription info's status updates stream? static var updates: Product.SubscriptionInfo.Status.Statuses { get } (https://developer.apple.com/documentation/storekit/product/subscriptioninfo/status/3851115-updates) @eskimo wondered if you could weigh in on this status change for auto-renew? Thanks in advance.
Jan ’22