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.

getAvailablePurchases never resolves if initConnection has not been run

See original GitHub issue

Version of react-native-iap

4.4.8

Version of react-native

0.61.4

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

iOS

Expected behavior

getAvailablePurchases() to reject with error when something is wrong.

Actual behavior

getAvailablePurchases() never ever returns the promise

Tested environment (Emulator? Real Device?)

Real device

Steps to reproduce the behavior

Call getAvailablePurchases without having called initConnection beforehand.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
AdamGerthelcommented, Aug 3, 2020

Also, if initConnection is a required step to run before doing anything else, wouldn’t it be better if react-native-iap kept track of that internally?

1reaction
birdofpreyrucommented, Aug 3, 2020

Hey @hyochan, I believe, you should update README examples to include .initConnection() call. As of now, it is absolutely not clear from README it should be called. And to make it more confusive, everything seems to work without it on Android, thus the problem appears out of nowhere during a transition from Android to iOS.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-iap just hangs on ios trying to get subscriptions ...
The request doesn't succeed, doesn't fail, doesn't crash. The JS promise is seemingly never resolved or rejected. Has anyone experienced this?
Read more >
dooboolab/react-native-iap (Raised $40.00)
iOS: This in-app purchase has already been bought for some sku's ... getAvailablePurchases never resolves if initConnection has not been run.
Read more >
How to use the react-native-iap.getAvailablePurchases ...
To help you get started, we've selected a few react-native-iap examples, based on popular ways it is used in public projects. Secure your...
Read more >
react-native-iap - npm
The react-native-iap module hasn't been maintained well recently. We are thinking of participating again and make the module healthier.
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