I have the typical StoreKit 2 manager class, where I check currentEntitlements for subscription.
I have filed a feedback (FB22349195), I hope someone can take a look at it.
func updateCustomerProductStatus() async {
var activeSubscription: String? = nil
// BUG: In some cases the currentEntitlements does not emit a transaction until the device is reboot
for await result in Transaction.currentEntitlements {
print("Found transaction: \(result)") // This print does not appear until a restart!
do {
let transaction = try checkVerified(result)
// Skip revoked transactions
if transaction.revocationDate != nil {
print("Skipping revoked transaction for \(transaction.productID)")
continue
}
// Skip expired subscriptions
if let expirationDate = transaction.expirationDate, expirationDate < Date() {
print("Skipping expired subscription for \(transaction.productID)")
continue
}
// Check product type
switch transaction.productType {
case .autoRenewable:
activeSubscription = transaction.productID
default: break
}
} catch {
print("Unable to verify transaction: \(error)")
}
}
// Update state once after processing all entitlements
self.activeSubscription = activeSubscription
print("updateCustomerProductStatus() activeSubscription: \(activeSubscription ?? "nil")")
}
There is some unexpected behavior where the currentEntitlements does not emit a result until the iPhone device is reboot.
This bug appeared in iOS 26.4 (and in the betas).
0
1
58