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.

[SOLVED] RNIap.getSubscriptions error : [TypeError: undefined is not an object (evaluating 'RNIapIos.getItems')]

See original GitHub issue

Version of react-native-iap

1.20

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

tested on iOS only

Expected behavior

get list of subscriptions

Actual behavior

RNIap.getSubscriptions error : [TypeError: undefined is not an object (evaluating ‘RNIapIos.getItems’)]

Tested environment (Emulator? Real Device?)

both

Steps to reproduce the behavior

const itemSkus = Platform.select({
  ios: [
    'com.shares.sharesapp',                     // I also tried ['BASIC', 'CLASSIC', 'MAX', 'PLUS'] ..
  ],
  android: [
    'com.shares.sharesapp',
  ],
});

async componentDidMount() {
    try {
      await RNIap.prepare();
    }
    catch (err1) {
      console.log("RNIap.prepare error : ", err1);
    }
    finally {
      console.log("finally");
      try {
        const products = await RNIap.getSubscriptions(itemSkus);
        console.log('Subscriptions', products);
      }
      catch (err) {
        console.log("RNIap.getSubscriptions error : ", err);
      }
    }
  }

I not able to connect with sandbox account in simulator capture d ecran 2018-06-20 a 15 37 42

and in real device, having these popup photo

Here is the list of subscriptions in App Store Connect capture d ecran 2018-06-20 a 12 42 30

Can someone please help me to setup this in good shape ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

9reactions
lc3t35commented, Jun 21, 2018

I had to manually install as described…

Manual installation
iOS

    In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]
    Go to node_modules ➜ react-native-iap and add RNIap.xcodeproj
    In XCode, in the project navigator, select your project. Add libRNIap.a to your project's Build Phases ➜ Link Binary With Libraries
    Run your project (Cmd+R)
5reactions
gurmanpsinghcommented, Sep 8, 2022

In 2022, the products fetch this way: // simple productIDs without bundle identifier. let allSkus={ skus:[ ‘productID1’, ‘productID2’, ] }

  RNIap.getSubscriptions(allSkus); // to fetch the products
  RNIap.requestSubscription({sku:'productID1'}) // to request the subscription.
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: undefined is not an object (evaluating 'subscription ...
In order to reproduce it, I have to refresh the app a few times, then I am getting this error. I tried googling...
Read more >
Debugging E_IAP_NOT_AVAILABLE error #1010 - Issuehunt
initConnection returns false; getSubscriptions returns error: TypeError: null is not an object (evaluating RNIapIos.getItems); requestSubscriptions returns ...
Read more >
How to use the react-native-iap.getProducts function in ... - Snyk
To help you get started, we've selected a few react-native-iap.getProducts examples, based on popular ways it is used in public projects.
Read more >
React Native: undefined is not an object (evaluating '_this ...
React Native: undefined is not an object (evaluating '_this.props. ... I'm trying to use SectionList but I'm getting the following error:
Read more >
Render Error undefined is not an Object (evaluating _react ...
In this video ,we fixed an error "Render Error undefined is not an Object ( evaluating _react.react .createElement)".
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