cordova-plugin-inapppurchase
cordova-plugin-inapppurchase copied to clipboard
Trying to get the products
I'm pretty sure this will sound silly, but i've tried by myself and get nothing, so...
I've implemented this method to get the product i have in the store and, when i try it i get the alert on the "then" function, but the value that shows it's 0.
I don't know what may be the problem. It's because it connects to the store but doesn't find anything?
function initStore(){ inAppPurchase .getProducts(['com.mydomain.myapp.code']) .then(function (products) { alert(products.length); }) .catch(function (err) { console.log(err); }); }
@Niusuce Have you managed to get this working?
Having the same issue on android. Products work fine for iOS.
@harpster604 then the problem is on the Google Developer Console. If your code works on iOS it will work with Android. Check the products ID, the Billing key and that stuff.
Remember that when you publish a product on the Google Developer Console, it takes 6 hours to be avaliable on the app.
Got this working yet, all i seem to get is "Object {code: -2, message: "Billing cannot be initialized"}"
@UP714581 Have you created the www/manifest.json file? I was dealing with the same error on Android, but had missed the instructions on doing this on the plugin's docs.
https://github.com/AlexDisler/cordova-inapppurchases-app/blob/master/www/manifest.json#L1
Greetings. Even though my in-app purchases that I added in itunesconnect is approved and is cleared for sale and the app version review is approved as well and it is in the Pending Developer Release status. When I try to do inAppPurchase.getProducts('com.myapp.my_prod') I get nothing in response. Though the result is successful but the response is empty and no products are displayed in the return object. Any thoughts?
@ahmu83 Try inAppPurchase.getProducts(['com.myapp.my_prod']) instead. Note the square brackets—to the best of my knowledge, getProducts() requires an array.
@ronobot My bad, that is exactly how I am doing inAppPurchase.getProducts(['com.myapp.my_prod']) and I am getting nothing in the response. The product I added in intunesconnect are clear for sale as well and approved.
@AlexDisler any suggestions?
Go over https://github.com/AlexDisler/cordova-plugin-inapppurchase#debugging If it still doesn't work then I'm not sure.
@AlexDisler what do you mean by "approved the contracts"? The products that I have added in my itunesconnect are approved. Here is a screenshot http://prntscr.com/f8ll4q
The IAP's were not retrievable because of the missing Contact Info, Bank Info, & the Tax Info in itunesconnect’s Agreements, Tax & Banking section. Thanks @AlexDisler, the issue is now resolved.
Go over https://github.com/AlexDisler/cordova-plugin-inapppurchase#debugging If it still doesn't work then I'm not sure.
Hi @AlexDisler , I'm using your plugin for In-app purchase subscription process on my app using ionic-react with Capacitor. It's working fine with iOS. But I'm getting error on Android. the error is:- { errorCode: -2, message: "Billing is not initialized", code: -2 }. I have already Created a menifest.json file something like this { "play_store_key": "MII....." }