SKPaymentTransactionState.purchased not receveid during interrupted purchase

Hi,

We recently implemented auto-renewable subscription IAPs and there seem to be problems for some users. During sandbox testing everything works as expected but in production we have been able to replicate following problem:
1) User with no payment method tries to subscribe, is shown that card should be addes. App receives SKError.unknown
2) User fills in the card details, returns to the app. App receives SKError.unknown once again
3) User taps buy again, and new payment is added to queue once again. Payment sheet appears and after user action popup with title "Authentication Required" appears (described here: https://developer.apple.com/support/psd2/)
4) User finishes authentication, return to the app and SKError.unknown is received.
5) This is the step when sometimes SKPaymentTransactionState.purchased is not received right after SKError.unknown. After killing the app and opening it, it's received.

Possible problem we have but which, I believe, should not have an impact on this problem - we are calling add (SKPaymentTransactionObserver) before AppDelegate.didFinishLaunchingWithOptions - it's called inside the initializer of our IAP class which is initialized as instance variable of AppDelegate.

Extra question, what should we do with all the SKError.unknown during interrupted purchase flow? Documentation says "the application can read the transaction’s error property to return a meaningful error to the user." here https://developer.apple.com/documentation/storekit/skpaymenttransactionobserver/1506107-paymentqueue . But how can meaningful error message be shown to user from unknown error code other than "Something went wrong"?


Add a Comment

Replies

Looks like transaction with purchased state is not received if user has not logged in the iOS settings and logs in during the interrupted purchase. It's possible to replicate this only in production environment and purchased transaction is received after killing and reopening the app.