You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
kMKStoreKitProductPurchasedNotification doesn't contain the transactionState. It's required to determine whether the product is purchases or restored.
#247
Open
funnel20 opened this issue
Sep 21, 2015
· 2 comments
When calling [[MKStoreKit sharedKit] restorePurchases] to restore earlier purchases, I was under the impression that only kMKStoreKitRestoredPurchasesNotification would be fired.
However, for each product kMKStoreKitProductPurchasedNotification is fired too (before kMKStoreKitRestoredPurchasesNotification).
The current notification object is only 'transaction.payment.productIdentifier'.
So there is no way in kMKStoreKitProductPurchasedNotification to determine whether the product is purchased or restored.
For several purposes I want to know that.
I have solved this by using the complete SKPaymentTransaction as object to kMKStoreKitProductPurchasedNotification:
When calling [[MKStoreKit sharedKit] restorePurchases] to restore earlier purchases, I was under the impression that only kMKStoreKitRestoredPurchasesNotification would be fired.
However, for each product kMKStoreKitProductPurchasedNotification is fired too (before kMKStoreKitRestoredPurchasesNotification).
The current notification object is only 'transaction.payment.productIdentifier'.
So there is no way in kMKStoreKitProductPurchasedNotification to determine whether the product is purchased or restored.
For several purposes I want to know that.
I have solved this by using the complete SKPaymentTransaction as object to kMKStoreKitProductPurchasedNotification:
Instead of:
SKPaymentTransaction contains the property "transactionState".
When receiving the notification in a class, the transaction ID can be retrieved via:
And the transactionState via:
The latter can be compared to SKPaymentTransactionStatePurchased or SKPaymentTransactionStateRestored.
The text was updated successfully, but these errors were encountered: