AlexDisler / cordova-plugin-inapppurchase

A lightweight cordova plugin for in app purchases on iOS/Android
316 stars 192 forks source link

How to get the products? #40

Open Script47 opened 8 years ago

Script47 commented 8 years ago

@AlexDisler I came across your plugin and thought I'd give it a go as it seems a lot cleaner than the others. However, I can't seem to get my products. I've created a single product which can be seen in this image. I wish to now retrieve that on my Android device.

I have created the manifest file as instructed in the WWW.

I'm using Intel XDK.

Your code / steps to reproduce

inAppPurchase.getProducts([
    'net.script47.demoapp.remove_ads'
]).then(function (item) {
    alert(item.length);
    alert(JSON.stringify(item));
    alert(item.price);
}).catch(function (err) {
    alert(err);
});

The code reaches the then block but alerts the following in their respective order:

0 [] undefined

Console output

N/A

Type of product you are working with consumable/non-consumable/subscription

Android Managed

Version of cordova

5.4.1

Version of iOS/Android

5.0.1

What am I doing wrong?

I'm stumped by this issue, any help will be grateful.

harpster604 commented 8 years ago

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