While testing renewable subscription purchasing with a Sandbox User I noticed something odd. In AppStoreConnect you can select a checkbox to interrupt any payments for a given sandbox user. If you do this during the payment process
- the payment should fail
- the user should be prompted to accept new terms and conditions of the app store
- and then a new transaction should be added to the PaymentQueue with the same product
My problem is: The delegate method is never triggered after that happens.
public func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction])
It does get triggered properly when I initiate transactions. It also seems like the transaction created AFTER user accepts T&C is added to the queue, but the method it self is only triggered and starts processing transactions when I either: add another transaction manualy OR minimize and reopen the app.
As per Apple documentation this seems almost correct:
StoreKit can notify your SKPaymentTransactionObserver instance automatically when the content of the payment queue changes upon resuming or while running your app.
Apple documentation for testing interrupted purchases for reference: https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/testing_in-app_purchases_with_sandbox/testing_an_interrupted_purchase
My question is how to handle such a transaction? For this interrupted transaction it always fail with a SKErrorCode of "unknown", and the only viable solution I found so far was to ask the user to restart the app which is not acceptable.
Any help would be appreciated. Thanks!