Use StoreKit 2 my client IAP code like this:
func purchase(_ product: Product) async throws -> Transaction? {
let orderId = UUID.init()
let result = try await product.purchase(options: [.appAccountToken(orderId)])
switch result {
case .success(let verification) :
let transaction = try checkVerified(verification)
//Here can I tell my server deliver content to user?
//I do not want valid transaction on device(just like valid receipt via S2S use Storekit1)
return transaction
case .userCancelled, .pending:
return nil
default:
return nil
}
}
If verificationResult return ..verified() case , can I tell my server deliver content to my customer ?
Or should I send originalID for this transaction to my server, my server has to fetch transaction info by history Api(decode JWS info) to decide whether to deliver content to my custom?
Thank you very much