question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SKUs not merged in getProducts and getSubscriptions

See original GitHub issue

Version of react-native-iap

1.3.6

Platforms you faced the error (IOS or Android or both?)

iOS

Expected behavior

Get a valid internal list merged with the results of getProducts and getSubscriptions

Actual behavior

The internal validProducts only contains the last result set of getProducts or getSubscriptions. This will end up in app store calls resulting in “Error: Invalid product ID.”.

Tested environment (Emulator? Real Device?)

Tested on the iOS emulator and the real device.

Steps to reproduce the behavior

I am running code like this with a “correct set” of SKUs in productSkuList and subscriptionSkuList:

const prepare = function* () {
    console.log('IAP: Preparing in app purchases');

    try {
        yield RNIap.prepare();

        const products      = yield RNIap.getProducts(productSkuList);
        const subscriptions = yield RNIap.getSubscriptions(subscriptionSkuList);

        yield RNIap.endConnection();
        yield put(PurchaseActions.prepareSuccess(products, subscriptions));
    } catch (error) {
        console.log('IAP: Error', error);

        yield RNIap.endConnection();
        yield put(PurchaseActions.prepareFailed());
    }
};

The products are loaded correctly but I am not able to run any buyProduct-call with SKUs from productSkuList since the internal array validProducts is overwritten by the different result from getSubscriptions. In my opinion this should be fixed or at least more detailed in the documentation since this will cost a lot of time to debug.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JJMooncommented, Aug 16, 2018

Oh. I got the point. I will fix it. Sorry for that.

0reactions
blaues0ckecommented, Sep 12, 2018

@dooboolab For sure, will do that an come back to you here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-iap - npm
This is a react-native link library project for in-app purchase for both android and ios platforms. The goal of this project is to...
Read more >
RNIap.getSubscriptions(itemSubs) give me an empty array ...
getProducts (itemSkus) gives me the product ... created in playConsole is coming but the subscription created is not coming my code is
Read more >
flutter_inapp_purchase | Flutter Package
In App Purchase plugin for flutter. This project has been forked by react-native-iap and we are willing to share same experience with that...
Read more >
Recharge API Reference - Introduction
403 - The request was authenticated but not authorized for the requested resource ... GET /subscriptions/{id}, subscription/activated ... /addresses/merge.
Read more >
All Azure Resource Provider Operations
Resource Provider Resource Type Namespace IsDataAction Microsoft.AAD DomainServices Domain Services Resource Provider False Microsoft.AAD DomainServices Domain Services Resource Provider False Microsoft.AAD DomainServices Domain Services Resource Provider...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found