Offer Code Transaction

Hello,

We're trying to implement and test offer codes in our app. We have create all the necessary items in the App Store. The app has been reviewed and approved for release. We have not published it yet. We are redeeming the offer using a URL that opens the App Store. When I redeem, the account is updated, but the app does not see the Transaction.

We implemented using this: https://developer.apple.com/documentation/storekit/transaction

First, we used the Transaction.updates and then we added Transaction.all and neither return any Transaction.

Any ideas with there are any other dependencies that are required here or recommendations for how to test?

Also, I should add with the StoreKit testing framework everything worked as expected. I'm wondering if there is some environment dependency with the App Store that we don't have. I have seen posts that say in-app purchases need to wait 48 hours. Our subscriptions have been defined and in use for years now. We just added offer codes for this release.

From Support offer codes redeemed outside of your app:

Customers may redeem offer codes outside your app, by entering the offer code in the App Store, or by using a redemption URL. To handle offer codes — and other transactions that can occur outside of your app — your app needs to use updates on Transaction to receive new transactions while the app is running. Create a Task to iterate through the transactions from the listener as soon as your app launches. For more information and sample code, see updates. When the app launches, it needs to check all or currentEntitlements on Transaction to get any transactions that may have occurred while the app wasn’t running. Process the transactions to ensure your app provides service for all products it’s entitled to.

Thank you @DTS Engineer . I understand that part of it and we have implemented that. We call this at app launch and when the app enters the foreground:

func checkForAllTransactions() {
        LogManager.shared.addLog(logString: LogMessageConstants.storeKit + " TransactionObserver checkForAllTransactions")
        Task(priority: .background) {
            for await verificationResult in Transaction.all {
                await self.handleAll(transaction: verificationResult)
            }
        }
    }

In terms of releasing and testing, we were not able to confirm this behavior and above function get any results using TestFlight pre-release. We have since had our app reviewed and approved and still are unable to confirm this behavior. Are there any special conditions that are required to be able to test it?

Thank you for your reply. We have implemented all the necessary code to listen for transactions that occur outside the app.

Our app has already been reviewed in the App Store, but we have not published it yet. We have waited 48 hours after activating all identifiers, but our padlock is still not being called as an observer when we attempt to redeem outside the app. We are performing the redemption via URL. To listen for transactions, we used

for await verificationResult in Transaction.updates {
                await self.handleUpdate(updatedTransaction: verificationResult)
            }

We also then tried with

for await verificationResult in Transaction.all {
                await self.handleAll(transaction: verificationResult)
            }

, but we still haven't had any success. Is there any other way to listen for transactions?

One question: Do we need to set SKIncludeConsumableInAppPurchaseHistory to true for offer codes? Does Apple consider offer codes to be consumable or non-consumable?

Offer Code Transaction
 
 
Q