kMKStoreKitProductPurchaseFailedNotification doesn't contain the error object. It's required to determine whether the user pressed Cancel (error.code == SKErrorPaymentCancelled) #246
On an error I'd like to show an Alert to the user.
However, when he presses cancel on one of the App Store Alerts (like entering App Store credentials), this kMKStoreKitProductPurchaseFailedNotification is also send.
If he presses Cancel I don't want to show an Alert.
In other words I need to now the error code.
On an error I'd like to show an Alert to the user. However, when he presses cancel on one of the App Store Alerts (like entering App Store credentials), this kMKStoreKitProductPurchaseFailedNotification is also send. If he presses Cancel I don't want to show an Alert. In other words I need to now the error code.
To do so, I changed the following line:
in:
by using the complete SKPaymentTransaction as object.
When receiving the notification in a class, the transaction ID can be retrieved via:
And the error code via:
The latter can be compared to SKErrorPaymentCancelled.