AlexDisler / cordova-plugin-inapppurchase

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

restorePurchases() - "Error retrieving purchase details" #259

Closed netse-ai closed 5 years ago

netse-ai commented 5 years ago

I am getting an error when I call restorePurchases() on android to get the user's current subscriptions. The error that it is returning is "Error retrieving purchase details".

this.iap
    .restorePurchases()
    .then((data) => {
      console.log(data);
      /*
        [{
          transactionId: ...
          productId: ...
          state: ...
          date: ...
        }]
      */
    })
    .catch((err) => {
      console.log(err);
    });

Very simple. Its the identical code from the readme.

At first I thought this was because of test subscriptions. I can confirm that this is happening with NON-TEST subscriptions. I published my app live to the store, downloaded it, and subscribed with real money. Why wouldn't restorePurchases() work? I've used it before and it worked fine.

This is a serious issue. It seems this plugin is no longer maintained?

EDIT So I was going through the inAppBillingV3.java and I changed the error to portray result.getMessage().

    if (result.isFailure()) {
            // callbackContext.error("Error retrieving purchase details'); //old line
            callbackContext.error(result.getMessage()); // new
            return;
    }

What I get now is a Class not found error. Not sure where to go with this.

EDIT Okay, so I excepted the Class not found error and I am left with this:

Error refreshing inventory (querying owned subscriptions). (response: -1003:Purchase signature verification failed)
netse-ai commented 5 years ago

Okay, for everyone that is having a similar issue, know that Google may change your play store key. I'm not sure how or why they did this, but the key I was using was no longer the key they provided for me. Double check your key!