I tried deleting the configuration file, but I ended up with an alert asking me to sign in with my sandbox ID. I did, and it returned an error: "Request Canceled". It is as if the purchase function doesn't update the currentEntitlements. This is my purchase function. Am I doing something wrong?
func purchase(_ product: Product) async throws {
let result = try await product.purchase()
switch result {
case .success(let verificationResult):
switch verificationResult {
case .verified(let transaction):
// Successful purchase - deliver content
await updatePurchasedProducts()
await transaction.finish()
// Go back to the map
integratePlanAhead()
case .unverified(_, let error):
// Purchase failed verification
throw error
}
case .userCancelled:
// User cancelled the purchase
break
case .pending:
// Purchase is pending (e.g., parental approval needed)
break
@unknown default:
break
}
}
It looks like purchases are never updated for my sandbox user... Thanks for any help :)