Describe the bug
I'm trying to add consumable purchases using the guide suggested in the docs. On purchase of the product, in a final check step, I want to check to ensure that RevenueCat has processed the transaction and has added it to the user's CustomerInfo object.
However on purchase of the consumable, the id/tranasctionIdentifier of the returned StoreTransaction from the Purchases.shared.purchase(package:) does not match the NonSubscriptionTransaction of the CustomerInfo.nonSubscriptions. This leaves us with no way of checking that the transactionId is valid or reflected in RevenueCat.
Looking into the NonSubscriptionTransaction, it has an internal storeTransactionIdentifier and this does match the StoreTransaction.id but because it's internal, it can't be used.
Can we make the NonSubscriptionTransaction .storeTransactionIdentifier public? If not, please can you advise on the best approach to achieve this check.
-
Environment
- Platform: iOS
- SDK version: 4.35.0
- StoreKit version:
- OS version: 14.3
- Xcode version: 15.2
- Device and/or simulator:
- Environment:
- How widespread is the issue. Percentage of devices affected.
-
Debug logs that reproduce the issue. Complete logs with Purchases.logLevel = .verbose will help us debug this issue.
(lldb) po transaction
<StoreTransaction:
identifier="2"
product="dream_dev_creation_premium"
date="2024-02-06 02:29:12 +0000"
quantity=1
>
vs
<NonSubscriptionTransaction:
productIdentifier=dream_dev_creation_premium
purchaseDate=2024-02-06 02:29:12 +0000
transactionIdentifier=38f13a6667
storeTransactionIdentifier=2
>
- Steps to reproduce, with a description of expected vs. actual behavior
- Purchase a consumable product
- Try to check the returned
StoreTransaction.id is contained in the customerInfo.nonSubscription using:
customerInfo.nonSubscriptions.first(
where: { $0.productIdentifier == transaction.productIdentifier && $0.transactionIdentifier == transaction.transactionIdentifier }
-
Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
N/A
-
Additional context
Add any other context about the problem here.
N/A
Describe the bug
I'm trying to add consumable purchases using the guide suggested in the docs. On purchase of the product, in a final check step, I want to check to ensure that RevenueCat has processed the transaction and has added it to the user's
CustomerInfoobject.However on purchase of the consumable, the
id/tranasctionIdentifierof the returnedStoreTransactionfrom thePurchases.shared.purchase(package:)does not match theNonSubscriptionTransactionof theCustomerInfo.nonSubscriptions. This leaves us with no way of checking that the transactionId is valid or reflected in RevenueCat.Looking into the
NonSubscriptionTransaction, it has aninternal storeTransactionIdentifierand this does match theStoreTransaction.idbut because it's internal, it can't be used.Can we make the
NonSubscriptionTransaction .storeTransactionIdentifierpublic? If not, please can you advise on the best approach to achieve this check.Environment
usesStoreKit2IfAvailable(true))Debug logs that reproduce the issue. Complete logs with
Purchases.logLevel = .verbosewill help us debug this issue.StoreTransaction.idis contained in thecustomerInfo.nonSubscriptionusing:Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
N/A
Additional context
Add any other context about the problem here.
N/A