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.

purchaseUpdatedListener called only once on app start, and never calls after requestSubscription call

See original GitHub issue

Version of react-native-iap

4.4.6

Version of react-native

0.61.5

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

ios

Expected behavior

purchaseUpdatedListener called on each time, after requestSubscription call

Actual behavior

purchaseUpdatedListener called only once on app start, and never calls after requestSubscription call

Tested environment (Emulator? Real Device?)

Real Device

Steps to reproduce the behavior

Just follow readme and try to request subscription

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:25 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
kidrocacommented, May 19, 2020

Had the same issue as I didn’t add the initConnection() call. The README seems to be just updated with the bold part here:

initConnection() On iOS, it will simply call canMakePayments method and return value which is required for the listeners to work properly.

I think this part “On iOS, it will simply call canMakePayments” should be removed, also initConnection() should be added to the basic example

I was really convinced it was optional because it wasn’t in the example

Adding the initConnection() before registering the purchase listener/s fixed this for me, so this is probably related to #1002 and #756

4reactions
stonesongcommented, May 7, 2020

I had the same issue for a few days with RN 0.62.2 and react-native-iap 4.4.8 I somehow missed the initConnection() probably because it is missing from the example in the README

Read more comments on GitHub >

github_iconTop Results From Across the Web

dooboolab/react-native-iap (Raised $40.00) - Issuehunt
purchaseUpdatedListener called only once on app start, and never calls after requestSubscription call. Unfunded#985created byStrate.
Read more >
Newest 'react-native-iap' Questions - Stack Overflow
I am using react-native-iap V8.1.1 and react-native V0.65.1 After calling requestSubscription method The log will be like "iap data: true" but as it...
Read more >
react-native-iap - npm
This is a react-native link library project for in-app purchase for both Android and iOS platforms. The goal for this project is to...
Read more >
React Native IAP - Javatpoint
The react-native module will help us access the phone's in-app purchase ... Not calling this method will cause other calls to be rejected...
Read more >
Purchases - React Native IAP
Once you have called getProducts() , and have a valid response, you can call ... that you start listening to updates as soon...
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