cordova-plugin-inapppurchase icon indicating copy to clipboard operation
cordova-plugin-inapppurchase copied to clipboard

Trying to get the products

Open Niusuce opened this issue 9 years ago • 13 comments

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 avatar May 26 '16 10:05 Niusuce

@Niusuce Have you managed to get this working?

Script47 avatar Jun 17 '16 04:06 Script47

Having the same issue on android. Products work fine for iOS.

harpster604 avatar Jul 03 '16 19:07 harpster604

@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.

Niusuce avatar Jul 03 '16 21:07 Niusuce

Got this working yet, all i seem to get is "Object {code: -2, message: "Billing cannot be initialized"}"

UP714581 avatar Aug 13 '16 12:08 UP714581

@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

ronobot avatar Dec 19 '16 18:12 ronobot

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 avatar May 11 '17 15:05 ahmu83

@ahmu83 Try inAppPurchase.getProducts(['com.myapp.my_prod']) instead. Note the square brackets—to the best of my knowledge, getProducts() requires an array.

ronobot avatar May 11 '17 17:05 ronobot

@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.

ahmu83 avatar May 12 '17 12:05 ahmu83

@AlexDisler any suggestions?

ahmu83 avatar May 16 '17 18:05 ahmu83

Go over https://github.com/AlexDisler/cordova-plugin-inapppurchase#debugging If it still doesn't work then I'm not sure.

AlexDisler avatar May 16 '17 18:05 AlexDisler

@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

ahmu83 avatar May 16 '17 19:05 ahmu83

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.

ahmu83 avatar May 20 '17 20:05 ahmu83

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....." }

ve-amitsharma avatar May 21 '20 13:05 ve-amitsharma