iaphub / react-native-iaphub

The easiest way to implement IAP (In-app purchase) in your React Native app.
https://www.iaphub.com/
MIT License
328 stars 23 forks source link

Unable to get the user when a product sku is not found #16

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi,

I try to use the "getUser()" method of the plugin. Except that if a product was not found in the platform in question, I never recovers the user with the rest of the products available ...

Tanks.

iaphub commented 4 years ago

Hi,

When a product is not found we are showing an error modal (using console.error), this modal won't be displayed if you compile the app in production. And the list of the products is still returned (except the product that isn't found). If you want to remove the product that doesn't exist you can remove it from your listing you created on IAPHUB and the error should disappear.

centrual commented 4 years ago

Hello,

It's happening to me too. Everything working for android but on ios "product not found" error happening. I tested this situation for development mode also production mode. Because of this error, the app store rejecting our application.

I checked API endpoint for ios, it's returning products. Also, I double-checked the product SKUs from the app store connect. Also, I added in-app products to release.

image

WhatsApp Image 2020-07-06 at 15 41 03

Başlıksız-1

image

image

image

image

Başlıksız-2

WhatsApp Image 2020-07-06 at 15 56 19

    try {
        //...
        await Iaphub.init(Config.IapHub as unknown as IapHubInitOptions);
        await Iaphub.login(GlobalUserStore.AccountId);
        await Iaphub.getUser();
        //...
      } catch (e) {
        console.log(e);
      }
iaphub commented 4 years ago

We've been in contact by email with @centrual, the issue ended up having the wrong product type (non-renewable subscriptions instead of renewable subscriptions). Closing the issue.