Subscription state not update if I subscribe in App Store sandbox instead of my app

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?

I 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?

Subscription status updates will come in via Product.SubscriptionInfo.Status.updates instead of Transaction.updates. Creating a task to observe those updates will help with your issue.

Subscription state not update if I subscribe in App Store sandbox instead of my app
 
 
Q