Reputation: 1394
Testing with latest Xcode 16.1 and iOS 18.2 on the real device with sandbox user. I setup sandbox user as described in Apple guide. Trying to purchase product:
func purchase(_ product: Product) async throws -> Transaction? {
guard let uuid = UUID(uuidString: "my test uuid") else { return nil }
let result = try await product.purchase(options: [.appAccountToken(uuid)])
switch result {
case .success(.verified(let transaction)):
purchasedNonConsumables.insert(product)
await transaction.finish()
return transaction
default:
return nil
}
}
It is working. On the device I see request with credentials for sandbox user etc. I need to reset purchases and it is not working at all, tried to delete sandbox user, but purchase still working. I am delete sandbox user in app connect and purchase is still working, so no request for new user etc.
Upvotes: 2
Views: 105