stripe-terminal-react-native icon indicating copy to clipboard operation
stripe-terminal-react-native copied to clipboard

Can't reconnect local reader on iOS when going background on enter pin screen

Open dakkor71 opened this issue 1 year ago • 9 comments

Describe the bug We are using EXPO to run the app. During the tests, we noticed that when the phone is going into the background on the enter pin screen we are not able to re-connect to the reader. We check both ^0.0.1-beta.13 and ^0.0.1-beta.14.

On ^0.0.1-beta.13 we are getting Could not execute connectReader because the SDK is busy with another command: processPayment.

On ^0.0.1-beta.14 connect to reader method hangs forever.

To Reproduce Steps to reproduce the behavior:

  1. Type *.03 amount (test stripe mode)
  2. Start the TTP payment process which follows the example app
  3. Tap the card
  4. Go into the background when the pin screen is visible

Expected behavior SDK should clear the state so we can easily reconnect when the app goes back active

Stripe Terminal React Native SDK version

  • ^0.0.1-beta.14
  • ^0.0.1-beta.13

Smartphone (please complete the following information):

  • Device: iPhone XS
  • OS: 16.6

Additional context It's working fine when going into the background on any other scenario, like on the tap the card, etc. Also, I was trying to find any method that could cancel processPayment (version 13) or confirmPaymentIntend (version 14) but was not able to find any.

dakkor71 avatar Dec 19 '23 07:12 dakkor71

hey @dakkor71 did you get a chance to check this behavior on beta.15? what are you experiencing for that?

nazli-stripe avatar Feb 23 '24 02:02 nazli-stripe

We were able to track this down as an issue with the underlying Terminal iOS SDK. Unfortunately it's not possible to fix this within the RN SDK, and will need to wait for an update to the iOS SDK. I'll update this issue when that happens

nazli-stripe avatar Feb 26 '24 23:02 nazli-stripe

@nazli-stripe No, I didn't test it on beta.15. I'm glad that you found the root problem and hope you will fix this issue soon. Thanks!

dakkor71 avatar Feb 27 '24 07:02 dakkor71

hey @dakkor71 can you test this on beta.16? this issue was fixed in iOS 3.4.0, which is the version beta.16 is built with

nazli-stripe avatar Mar 26 '24 06:03 nazli-stripe

Hey @nazli-stripe!

Need to update EXPO to 50 and will let you know ;)

Cheers!

dakkor71 avatar Mar 26 '24 09:03 dakkor71

@dakkor71 are you running into this issue on beta.17?

nazli-stripe avatar Apr 04 '24 15:04 nazli-stripe

@nazli-stripe Thanks for releasing beta.17. Now we are able to proceed with the EXPO update. It could take some time because we have to adjust our app to a new version but I will let you know ASAP.

Cheers

dakkor71 avatar Apr 04 '24 15:04 dakkor71

It's still not working fine or maybe I'm doing something wrong:

I can see in the logs:

 LOG  [Stripe terminal]: didRequestReaderInput ["tapCard"]
 LOG  [Stripe terminal]: didChangePaymentStatus ready
 LOG  [Stripe terminal]: didChangePaymentStatus processing
 
 I can see enter pin screen and then I'm clicking side button and going into background
 
 LOG  [Stripe terminal]: didChangePaymentStatus notReady
 LOG  [Stripe terminal]: didChangeConnectionStatus notConnected

Then going back into active state and I can still see the discoveredReaders and connectedReader returned from the useStripeTerminal hook.

  • If I try to retry payment using the same connectedReader it hangs on collectPaymentMethod
  • If I will try to connectLocalMobileReader using reader from discoveredReaders it hangs
  • If I try calling disconnectReader it hangs

dakkor71 avatar Apr 26 '24 08:04 dakkor71

hey @dakkor71 sorry for the delay here, and thanks for reporting it. We still have it identified as an issue with the native iOS SDK and are tentatively aiming to have it fixed in the 3.9.0 release

nazli-stripe avatar Jul 19 '24 18:07 nazli-stripe