I'll be sending it to TestFlight soon to try if it works there, was hoping to sort it out before submitting!
I forgot to add in my original post, the call to purchase() (which is NOT popping a confirmation to purchase dialog) is returning a successful and verified result....but, the expiry date on the transaction is in the past....
Note: I've XXXX'd out some fields that shouldn't be relevant. Ran this at 6:12 p.m (GMT/UTC) on January 13, 2023, so should be expired....which would explain why later on, in self.updatePurchasedProducts(), Transactions.currentEntitlements is empty. But still no idea why there's a successful transaction and no confirmation dialog in the first place!
{
"bundleId" : "app.XXXXXXXXXXXXXXXXXX",
"deviceVerification" : "Y+Jlapp.XXXXXXXXXXXXXXXXXXJnwgU0qV7YMP6x\/I",
"deviceVerificationNonce" : "42e5c641-2a67-4815-b162-3c15515028ea",
"environment" : "Sandbox",
"expiresDate" : 1673556592000,
"inAppOwnershipType" : "PURCHASED",
"originalPurchaseDate" : 1673369053000,
"originalTransactionId" : "2000000246509209",
"productId" : "XXXXXXXXXXXXXXX",
"purchaseDate" : 1673554432000,
"quantity" : 1,
"signedDate" : 1673559083181,
"subscriptionGroupIdentifier" : "21XXXXXXXXXXXXXXXXXX3",
"transactionId" : "2000000248833618",
"type" : "Auto-Renewable Subscription",
"webOrderLineItemId" : "2000XXXXXXXXXXXXXXXXXX7"
}
Original Purchase Date: 2023-01-10 16:44:13 +0000
Purchase Date: 2023-01-12 20:13:52 +0000
Expiration Date: 2023-01-12 20:49:52 +0000
Signed Date: 2023-01-12 21:31:23 +0000
let result = try await product.purchase()
switch result {
case .success(let verificationResult):
switch verificationResult {
case .verified(let verifiedSuccessfulTransaction):
print(verifiedSuccessfulTransaction)
print("Original Purchase Date: \(verifiedSuccessfulTransaction.originalPurchaseDate ?? Date(timeIntervalSince1970: 0) ) ")
print("Purchase Date: \(verifiedSuccessfulTransaction.purchaseDate ?? Date(timeIntervalSince1970: 0) ) ")
print("Expiration Date: \(verifiedSuccessfulTransaction.expirationDate ?? Date(timeIntervalSince1970: 0) ) ")
print("Signed Date: \(verifiedSuccessfulTransaction.signedDate ?? Date(timeIntervalSince1970: 0) ) ")
await verifiedSuccessfulTransaction.finish()
await self.updatePurchasedProducts()
Topic:
App & System Services
SubTopic:
StoreKit
Tags: