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

Couldn't receive callback from postponed transaction. #20

Open
joyeon opened this issue Mar 11, 2016 · 7 comments
Open

Couldn't receive callback from postponed transaction. #20

joyeon opened this issue Mar 11, 2016 · 7 comments

Comments

@joyeon
Copy link

joyeon commented Mar 11, 2016

Hello there,

Thanks for this useful plugin!

I found a react-native app couldn't receive the callback properly when itunes store postpones a transaction because of some reason like user verification, but It asks ths user to purchase an item again after verification. Because when itunes store postpones a transaction, It drops SKPaymentTransactionStateFailed first and the native module remove the callback at that time.

I tried to remove callback only when the user cancels the transaction. But I'm not sure It is proper way.

Thanks,

@chirag04
Copy link
Owner

@joyeon Does apple post two events one SKPaymentTransactionStateFailed and something else later after verification?

@joyeon
Copy link
Author

joyeon commented Mar 11, 2016

Yes apple ask to let user purchase again after verification. If the user accept it, apple post an event SKPaymentTransactionStatePurchased.

@chirag04
Copy link
Owner

Interesting. Not sure what's the correct way to handle this. We should not leak callbacks when we get SKPaymentTransactionStateFailed.

Maybe it's time to move away from callback based pattern to an event based one. @joyeon you want to send a PR?

@joyeon
Copy link
Author

joyeon commented Mar 11, 2016

Will try to send PR but It could take time. If you want to patch it immediately please do it without hesitation.

@mcrowe
Copy link

mcrowe commented Mar 9, 2017

I have been experiencing this same issue. I believe this is because this library is focused on a callback pattern, which only listens for transaction changes during the lifetime of that request. Best practices are to listen for transactions when the app launches so that postponed requests like this are seen. See Apple's description for more details.

This happens quite rarely, and I'm not sure how to recreate it deliberately. We get about 750 new subscriptions per month, and this seems to happen to about 1 user per month. Still, it leads to a pretty frustrating experience for that 1 user.

As @chirag04 suggests, I think the solution lies in moving towards an event-based architecture. I will be working on a solution imminently. I may provide a PR, or create a new library, depending on the extent of the changes needed.

@mcrowe
Copy link

mcrowe commented Mar 14, 2017

This is related to #31

@lefoy
Copy link

lefoy commented Nov 22, 2017

Any news on this? I'm having the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants