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.

TypeError: getAndroidModule().isReadyAndroid is not a function.

See original GitHub issue

isReadyAndroid is not implemented in the native layer. Perhaps it was left out during the migration to kotlin?

Version of react-native-iap

8.0.1

Version of react-native

0.64.2

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

Android

Expected behavior

isReadyAndroid is implemented and returns a Promise<boolean>

Actual behavior

isReadyAndroid raises a TypeError (TypeError: getAndroidModule().isReadyAndroid is not a function.)

Tested environment (Emulator? Real Device?)

Nokia 5.4

Steps to reproduce the behavior

just call RNIap.isReadyAndroid()

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
ospfrancocommented, May 10, 2022

IMO removing it is bad.

For us, it was necessary because we kept the android connection alive outside of a single container but rather inside of some redux state, (we didn’t just have one screen that used the object, but queried the API at different points to show different prices and special offer screens). Therefore using hooks that automatically re-initialize the connection when the component mounts/unmounts was simply not sufficient.

Since there was no way to check if the connection was alive or not we would have to re-initialize the connection every time we would need to query it. The connection got killed at “random” times (device would go to sleep, app would go to background) but not always depending if the user would re-open the app in a certain interval.

So basically… the method was needed, not just a convenience. But I haven’t checked the codebase, if you can guarantee the google api connection is alive 100% of the time, then there is no need to expose this to JS, but if the connection can still silently die and any init method needs to be called, then there needs to be something to check the state.

0reactions
mcjambicommented, Jun 19, 2022

i have the same issue here, isReadyAndroid is not exist, and i do not know why document has it

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError _this2.getWifiList().bind is not a function. React ...
The issue is in the way you are calling .bind() : this.getWifiList().bind(this). Note that .bind() is a method of the Function prototype, ...
Read more >
dooboolab/react-native-iap (Raised $40.00) - Issuehunt
clearTransaction() throwing "Cannot finish a purchasing transaction" ... acknowledgePurchaseAndroid is not a function ... TypeError: getAndroidModule().
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