AlexDisler / cordova-plugin-inapppurchase

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

Error checking for Billing V3 support #267

Closed Bandito11 closed 5 years ago

Bandito11 commented 5 years ago

Please include:

Your code / steps to reproduce

  buy(productId: string): Promise<IProductBought> {
    return new Promise((resolve, reject) => {
      this.iap.buy(productId)
        .then(product => resolve(product))
        .catch(err => {
          const message = this.handleError(err);
          reject(message);
        });
    });
  }

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

non-consumable

Version of cordova

8.1.2

Version of iOS/Android

Android Pie

cordova ios: 5.0.0 cordova android: 8.0.0

Screen Shot 2019-04-08 at 1 28 04 PM

I was using the same code and it worked before the latest update to 1.2.0. I don't know what I am doing that is wrong. The manifest.json is in the WWW folder. I can get the products from the Play Store and Restore the purchase. If I already bought it I get the error message that I already bought it. But if I try to buy it (using another account) I just can't buy it and it shows me the error message in the picture.

I am using ionic 4 and I upgraded from ionic 3. It is working fine on iOS.

Bandito11 commented 5 years ago

The error was on my part. I was saving the product id's on the device so the user didn't have to download the info everytime they went to the setting page but didn't realize that I had to get the products ID everytime in order to run this plugin.