react-native-iap icon indicating copy to clipboard operation
react-native-iap copied to clipboard

how to set activityIndicator loading before IAP sheets pop up?

Open pouya92 opened this issue 7 years ago • 2 comments

Version of react-native-iap

3.3.9

Version of react-native

59.9.6

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

Both

Expected behavior

set a loading modal(activityIndicator) while payment sheet going to pop up and alos set this loading after user confirm to pay and remove it if user cancel the purchase.

Tested environment (Emulator? Real Device?)

real device

I need to show user that he/she need to wait until payment sheet shows up, so I want to use a simle loader component for this purpose but I dont know how to stop it if user cancel payment, by default when use press the buy button I will show my loading component bu I need to know if user cancel payment I remove the loader.

pouya92 avatar Aug 22 '19 07:08 pouya92

In that use case, you can stop loading when something happens in the purchaseErrorListener

If a user cancels, an event will trigger. And purchaseErrorListener listens for that event.

A cancel will result in "Cannot connect to iTunes Store". This is a bit of a crap message to work with for what actually happens...

jvandenaardweg avatar Aug 22 '19 13:08 jvandenaardweg

Thanks, that works

pouya92 avatar Aug 25 '19 09:08 pouya92