Closed cquezpro closed 7 years ago
@sirius2013 @kjakub
You must be using the examples for the old version of this plugin.
In the last version (4.0.0) the receipt is not sent into onPurchase
rather than it should be explicitly loaded from the storekit
(https://forum.ionicframework.com/t/check-for-already-purchased-iaps-with-ng-storekit-on-ios/7844/5):
IAM.onPurchase = function (transactionId, productId) {
storekit.finish(transactionId);
storekit.loadReceipts((receipts) => {
console.log('Receipt for appStore = ' + receipts.appStoreReceipt);
console.log('Receipt for ' + transactionId + ' = ' + receipts.forTransaction(transactionId));
});
}
The same situation is with onRestore()
.
@moskalen thank you, will try
Hi everyone! After call IAP buy with product ID, I got onPurchase callback successfully, and got transactionID: 10000000179227042, productId: diett.unlock_yearly correctly.
But receipt is 'undefined',
Anyone help this please? Thank you $scope.purchase1Year = function () { IAP.buy('diett.unlock_yearly'); }; IAP.buy = function (productId) { storekit.purchase(productId); };
IAP.onPurchase = function (transactionId, productId, receipt) { alert("onPurchase: " + transactionId + " ," + receipt + ", " + productId); };