I ran the SKDemoApp using Xcode 13.0 beta (13A5155e) and found that even if the transactions were finished in the detach task, all transactions were presented again in the next renewal.
func listenForTransactions() -> Task.Handle<Void, Error> {
return detach {
//Iterate through any transactions which didn't come from a direct call to `purchase()`.
for await result in Transaction.updates {
do {
let transaction = try self.checkVerified(result)
print("tid: \(transaction.id!)")
//Deliver content to the user.
await self.updatePurchasedIdentifiers(transaction)
//Always finish a transaction.
await transaction.finish()
} catch {
//StoreKit has a receipt it can read but it failed verification. Don't deliver content to the user.
print("Transaction failed verification")
}
}
}
}
With above code snippet I printed the transaction id and it looked like this:
tid: 0
tid: 0
tid: 1
tid: 0
tid: 1
tid: 2
tid: 0
tid: 1
tid: 2
tid: 3
tid: 0
tid: 1
tid: 2
tid: 3
tid: 4
tid: 0
tid: 1
tid: 2
tid: 3
tid: 4
tid: 5
Is this the expected behavior?