if let status = try await product.subscription?.status {
for state in status {
if (state.state == .subscribed) {
isPro = true
break
}
}
}
When I subscribe with the api product.purchase in my app, every thing work right. The state is updated to .subscribed right after the purchase finished. However, when I manage the subscription in App Store sandbox with a test account. The subscription state does not updated until I manually ask for another purchase in my app. Then a window popup telling me that I have already purchased this product. And then the state of the subscription also updated to .subscribed.
I have also made a update listener to listener all transaction update, just like how SKDemo do. But seems it doesn't receive any update.
Last, could any one tell me that if the update listener also responsible for listening the expiration of a subscription?
-
—
long123
Add a CommentI found that calling AppStore.sync() help refreshing all the states. I thought there is no need to manually trigger sync in this situation. Am I wrong? https://developer.apple.com/documentation/storekit/appstore/3791906-sync
And I found another problem that auto renew transactions are not captured by Transaction.updates, so when I call Transaction.unfinished after AppStore.sync(), there are some unfinished transactions. Is this normal or I do miss the transaction update?