Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promise returned by requestSubscription never resolved #632

Closed
Chehow opened this issue Aug 9, 2019 · 9 comments
Closed

Promise returned by requestSubscription never resolved #632

Chehow opened this issue Aug 9, 2019 · 9 comments
Labels
🤖 android Related to android 🙏 help wanted Extra attention is needed ❓ question Further information is requested

Comments

@Chehow
Copy link

Chehow commented Aug 9, 2019

Version of react-native-iap

3.3.9

Version of react-native

0.60.3

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

Android only (IOS works fine)

Expected behavior

Promise returned by requestSubscription should be resolved

Actual behavior

Promise returned by requestSubscription never resolved

Tested environment (Emulator? Real Device?)

Real Device + Sandbox

Steps to reproduce the behavior

await iap.requestSubscription();
console.log('This string does not print')

@hyochan hyochan added 🤖 android Related to android ❓ question Further information is requested labels Aug 9, 2019
@hyochan
Copy link
Member

hyochan commented Aug 9, 2019

Could you also test if the result is returned in purchaseUpdatedListener? The promises will be deprecated in the future maybe in 4.0.0+

@Chehow
Copy link
Author

Chehow commented Aug 9, 2019

Yes, It works fine in purchaseUpdatedListener (and I use it save subscription). I wanted to use promise because there is a delay between user click 'Buy' and payment modal appears on IOS (to show spinner). And It works fine currently on IOS. But for android it never resolved (so I will need to have special case in source code to handle it).
Thx for the answer and good job on this module.

@TStupariu
Copy link

I can confirm this use case happens to me as well with the latest version of react-native-iap and React Native 0.60.3

@pliashkou
Copy link

Faced it with the latest version of react-native-iap & React Native 0.60.4

@pierregoutheraud
Copy link

Same problem with react-native@0.61 and react-native-iap@3.5.2 on Android.

@hyochan hyochan added the 🙏 help wanted Extra attention is needed label Sep 30, 2019
@hyochan
Copy link
Member

hyochan commented Sep 30, 2019

Please try 3.5.3 and comeback. There was one missing promises return in android when the purchases is null.

@pierregoutheraud
Copy link

pierregoutheraud commented Oct 2, 2019

@hyochan Still not working on 3.5.6.
So RNIapModule.buyItemByType does not seem to resolve its promise ? Can not really help you with java code though :'-(

hyochan added a commit that referenced this issue Oct 2, 2019
Attempt to resolve #632
@hyochan
Copy link
Member

hyochan commented Oct 2, 2019

@pierregoutheraud Could you try 3.5.7? If you still help the problem please try to post some related logcat that can give more hint.

@pierregoutheraud
Copy link

@hyochan I tried installing 3.5.8 and I am now getting an unrelated new error Cannot read property 'getAvailableItemsByType' of undefined when using getAvailablePurchases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 android Related to android 🙏 help wanted Extra attention is needed ❓ question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants