stripe / stripe-terminal-react-native

React Native SDK for Stripe Terminal
https://stripe.com/docs/terminal/payments/setup-integration?terminal-sdk-platform=react-native
MIT License
110 stars 50 forks source link

Tap to pay not working on iOS 18 #830

Open manashathparia opened 1 month ago

manashathparia commented 1 month ago

Describe the bug Tap to pay not working on iOS 18 devices consistently. iOS 17 and bellow devices seems to be working fine. However, if one connects to a terminal reader before connecting to tap to pay, it does seem to be working.

To Reproduce Steps to reproduce the behavior:

Use tap to pay on iOS 18

Expected behavior It should work consistently

Screenshots If applicable, add screenshots to help explain your problem.

Stripe Terminal React Native SDK version

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

manashathparia commented 1 month ago

upon debugging using Xcode, it seems that the connectLocalMobileReader method is not resolving, causing the process to hang.

       const connectMobileReader = async (reader: any, onConnect?: any) => {
          console.log('Connecting to mobile reader:', reader);

        const { error } = await connectLocalMobileReader({
              locationId: location.data?.data.stripe_id,
              reader: reader || (mobileReader as Reader.Type),
        });

        if (error) {
              log({
                    message: 'Error connecting to mobile reader',
                    error,
              });
        }
  };

Screenshot 2024-10-08 at 1 14 39 AM Screenshot 2024-10-08 at 1 14 24 AM

tim-lin-bbpos commented 1 month ago

I've test on my end on an iOS 18 device using the dev-app(https://github.com/stripe/stripe-terminal-react-native/tree/main/dev-app) and unfortunately it works from connect to successful payment so I'm a bit confuse about the issue you mentioned. It seems related to connect? and what is the error log you get? It seems no Error connecting to mobile reader according to your code. And in your log it also contains BT connection related stuff, what is your steps? Thank you in advance.

manashathparia commented 1 month ago

Well there isn't any error from the connectLocalMobileReader, its just gets stuck at that(connectLocalMobileReader) method. However the issue is not 100%, it occurs randomly and works the other times. with our testing on iOS 17 the app behaves perfectly fine, implicating that the issue is only on >=iOS 18.0

The bluetooth related logs in the ss is from the terminal reader scan I believe. the steps include:

  1. disconnect any connected terminal reader
  2. cancel any pending readers search
  3. call the discover method for localMobileReader
  4. connect to the discovered reader

@tim-lin-bbpos

tim-lin-bbpos commented 3 weeks ago

Sorry it take a while to test which part the issue is and also discuss internally with different people, so far we still not able to reproduce by just changing connection method. Would it be possible from your end to test the same condition using our dev-app to see if it still happened? And the same time we'll also try to see if there's other possibility to this issue. Thanks.

manashathparia commented 3 weeks ago

yes sure @tim-lin-bbpos

nazli-stripe commented 3 weeks ago

Looking at our logs for the device in screenshots (serial fa8572a6cf7ab50955f7c6837b8ef781574577fe8ebd09b2cd1471d14c62aee5) the main error we see is Already_connected_to_a_reader._Disconnect_from_the_reader,_or_power_it_off_before_trying_again. Just want to rule out you are aware of that and are handling it.

manashathparia commented 2 weeks ago

yes @nazli-stripe I am aware of it and it is handled in the function

manashathparia commented 1 week ago

@tim-lin-bbpos is there any update on this issue?

nazli-stripe commented 1 week ago

hey @manashathparia can you follow these instructions and share the logs with us for when the connection issue happens? https://it-training.apple.com/tutorials/support/sup075/

shivamshivk commented 3 days ago

Hi @nazli-stripe @tim-lin-bbpos

Please find the logs file in this drive link : https://drive.google.com/drive/folders/14bEQYYpCshsJnZqlxZkBwjLJ9kWiiTtl