iaphub / react-native-iaphub

The easiest way to implement IAP (In-app purchase) in your React Native app.
https://www.iaphub.com/
MIT License
320 stars 21 forks source link

TypeError: Cannot read property 'startListening' of undefined #5

Closed sayem314 closed 4 years ago

sayem314 commented 4 years ago
infoLog.js:16 Running "Loader" with {"rootTag":21}
core.js:37 TypeError: Cannot read property 'startListening' of undefined
    at Object.purchaseUpdatedListener (index.js:605)
    at Iaphub.init$ (index.js:88)
    at tryCatch (runtime.js:45)
    at Generator.invoke [as _invoke] (runtime.js:274)
    at Generator.prototype.<computed> [as next] (runtime.js:97)
    at tryCatch (runtime.js:45)
    at invoke (runtime.js:135)
    at runtime.js:145
    at tryCallOne (core.js:37)
    at core.js:123

Error is at https://github.com/iaphub/react-native-iaphub/blob/87aa7cb4c7c19e53709fd9839aeee1a07ded3e87/src/index.js#L87-L107

iaphub commented 4 years ago

Hi @sayem314, You're probably facing this issue because the dependency react-native-iap isn't linked properly. Check the "Getting Started" of react-native-iap, it should fix your issue.

Let me know if it works 🙂