Open jersobh opened 7 years ago
Current code:
inAppPurchase.restorePurchases() .then(function (purchases) { if (purchases.length > 0){ for (let purchase of purchases) { if(purchase.productId == 'assinatura' && purchase.state == 0){ console.log('assinante') self.subscription = true } else { Dialog.create({ title: 'Assinatura', message: 'Sua assinatura não pode ser verificada', buttons: [ 'Cancelar', { label: 'Assinar', handler () { self.subscribe() } } ] }) } } }
Same here. Mentioned in #79
Please, I've seen many people talking about many different ways to implement this. I'm only using for android, so as I saw many doing, I don't need the getRecipt method, right?
This is my code: `checkSubscription () { var self = this inAppPurchase.getProducts(self.productIds) .then(function (products) { self.products = products; }) .catch(function (err) { console.log(err); });
1st: I only have one product (the subscription). Do I need to use "getProducts"? 2nd: data[i]["state"] was data[i].state before. But it comes blank.
The app in published as alpha, the key is on the manifest.json (the purchase function WORKS). Please, I just need to check if the user is a subscriber.