StoreKit 2: Issue with Subscription Validation in Sandbox

I'm opening this post because I've encountered a perplexing issue in my application utilizing StoreKit 2 with the Sandbox environment for subscription validation.

My app makes a server call each time it opens to verify if there's an active subscription.

The problem arose after successfully making a purchase in the Sandbox. When I clear history from the Sandbox user and reopen the app, it resends a request to check the subscription, indicating that the user is still subscribed even though the purchases were deleted. Has anyone encountered a similar issue?

if I testing it with transaction manager in Xcode it working well.

`

 func updatePurchasedProducts() async {
for await result in Transaction.currentEntitlements {
    guard case .verified(let transaction) = result else {
        continue
    }
    
    if transaction.revocationDate == nil {
        self.purchasedProductIDs.insert(transaction.productID)
        print("# purchased")
    } else {
        self.purchasedProductIDs.remove(transaction.productID)
        print("# canceled")
    }
}

}

Thank you very much!

StoreKit 2: Issue with Subscription Validation in Sandbox
 
 
Q