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

requestSubscription promise is not resolved #984

Closed
Strate opened this issue Apr 21, 2020 · 9 comments
Closed

requestSubscription promise is not resolved #984

Strate opened this issue Apr 21, 2020 · 9 comments
Labels
🙏 help wanted Extra attention is needed 📱 iOS Related to iOS 🚶🏻 stale Stale

Comments

@Strate
Copy link

Strate commented Apr 21, 2020

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

requestSubscription promise is resolved

Actual behavior

requestSubscription promise never resolved

Tested environment (Emulator? Real Device?)

Real Device

Steps to reproduce the behavior

Just follow readme and try to request subscription

@hyochan
Copy link
Member

hyochan commented Apr 21, 2020

We recommend this to be handled in purchaseUpdated event handler. Therefore, resolving this method seems quite useless but if this should be handled, I'll take a look.

@hyochan hyochan added 🙏 help wanted Extra attention is needed 📱 iOS Related to iOS labels Apr 21, 2020
@Jobeso
Copy link

Jobeso commented Apr 29, 2020

@hyochan Resolving the promise would create a consistent api as requestPurchase is a promise as well that resolves. Additionally, this creates an easy implementation for showing a spinner while the user is purchasing. Using the purchase update listener for that would require a more complex architecture.
Thank you so much for your amazing work on this library!

@maxs15
Copy link
Contributor

maxs15 commented Apr 30, 2020

hyochan is correct, you must support support the purchaseUpdated event because if something fails the receipt could be triggered later, like when restarting the app.

Resolving a promise after the purchaseUpdated event is triggered (to make things easier like showing a spinner) is possible though, it is supported in react-native-iaphub

@marnusw
Copy link

marnusw commented Apr 30, 2020

I believe this is down to the same problem as #985. The promise does resolve in v4.4.3 of the library and the purchaseUpdated event fires, but in any later version (up to 4.4.8), neither happens.

@Jobeso
Copy link

Jobeso commented Apr 30, 2020

Thanks for both of your replies.

@maxs15 the purchase is handled by the purchaseUpdated handler but since it is an event handler it is not bound to the component, so implementing the spinner with the event handler requires more effort, how much is depending on the app architecture.

@marnusw Could be related. I am running v4.4.3 and it is not working for me there either.

@alexpchin
Copy link

Does anyone have an example of how best to show a loading icon when purchasing? It seems quite complex to do this in the purchaseUpdateSubscription?

@alexpchin
Copy link

Any update on how best to show a loader whilst waiting for the purchase to complete?

@stale
Copy link

stale bot commented Sep 15, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the 🚶🏻 stale Stale label Sep 15, 2020
@stale
Copy link

stale bot commented Oct 15, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙏 help wanted Extra attention is needed 📱 iOS Related to iOS 🚶🏻 stale Stale
Projects
None yet
Development

No branches or pull requests

6 participants