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.

Could not initConnection on version 2.2.2

See original GitHub issue

Version of react-native-iap

2.2.2 (latest) React native 57.0

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

Android

Expected behavior

Could init connection

Actual behavior

Init connection returns null

Tested environment (Emulator? Real Device?)

Differents real devices

Steps to reproduce the behavior

  1. I have created a alpha testing app in the playstore with the package com.mycompany.myapp

  2. I have created and activated products and subscriptions

  3. The app is on “Published” state on the playstore

  4. The merchant account is active

  5. I have integrated the library, added and linked it.

  6. I have tried this:

import * as RNIap from 'react-native-iap';

 try {
            let cnn = await RNIap.initConnection();
            if(cnn){
                console.warn(cnn)
            }else{
                console.warn("Nope")
            }
            let products = await RNIap.getProducts(itemSkus);
                console.warn(products )

        } catch(err) {
            console.warn(err);
       }
 }


cnn = null and getProducts = empty array

The app.build.gradle has:

compile project(':react-native-iap')

The settings.gradle has:

include ':react-native-iap'
project(':react-native-iap').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-iap/android')

The Manifest has this permissions:

 <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="com.android.vending.BILLING" />

Im running the app using react-native run-android

Any ideas of how can i troubleshoot this?

Also, how is this library working? the initConnection method checks if there is any app in the playstore with the app id = com.mycompany.myapp ?

Thanks

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
marcosmartinez7commented, Sep 26, 2018

Thats an ios issue with the purchase, i cant even get the connection… any ideas?

0reactions
marcosmartinez7commented, Sep 28, 2018
  1. Is on alpha. I THINK that you need to first generate a signed apk and add it to the alpha testing first.
  2. Nop, just use the id that you assigned on the playstore. If the product id is “pepito”, use “pepito”.
  3. No! It doesnt work in emulators, use a real device.

Also, make sure that if you are using getProducts youre trying to getting consumable products instead of subscription. There is a getSubscriptions method for that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SUP 2.2.2: cannot start SCC Services - SAP Community
Hello, We've noticed that our SCC (version 3.2.7) will not start on out test SUP 2.2.2 system. We've recently patched from 2.2.1 to...
Read more >
react-native-iap - npm
Latest version: 10.1.0, last published: 8 days ago. Start using react-native-iap in your project by running `npm ... 2.2.2 • Public • Published...
Read more >
How to correctly integrate HSQLDB with Spring Boot?
I saw this post : How to start HSQLDB in server mode from Spring boot application but can't manage to get it working....
Read more >
Problem with closing connection on client side| JBoss.org Content ...
Hi, I have two applications and they are published on two different JBoss servers. The first server (client): - Default server configuration -...
Read more >
Telethon Documentation - Read the Docs
with an error such as “ImportError: cannot import name 'TelegramClient' . . . ”. 2.2.2 Signing In. We can finally write some code...
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