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

App crashing when using discoverReaders method.

Open ankitharitus opened this issue 1 year ago • 6 comments

Describe the bug My native app is crashing when i am calling discoverReaders method.

To Reproduce Steps to reproduce the behavior:

const {error} = await discoverReaders({ discoveryMethod: 'localMobile', });

Expected behavior it should either give some error or in success callback

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

Stripe Terminal React Native SDK version

  • "@stripe/stripe-terminal-react-native": "^0.0.1-beta.19",

Smartphone (please complete the following information):

  • Browser Chrome

Additional context Add any other context about the problem here.

ankitharitus avatar Jul 06 '24 08:07 ankitharitus

Stripe Terminal is not supported in browser. The provider should not be embedded at all on Web (we did this by wrapping it in our own context with conditional rendering)

nabilfreeman avatar Jul 08 '24 10:07 nabilfreeman

@nabilfreeman i am checking in xcode simulator not on web browser.

ankitharitus avatar Jul 08 '24 13:07 ankitharitus

Im getting the same issue on IOS. Im using the function:

const { error } = await discoverReaders({
      discoveryMethod: 'bluetoothScan',
    })

and it completely crashes my application

DaviddStewarttCT avatar Jul 19 '24 14:07 DaviddStewarttCT

@ankitharitus @DaviddStewarttCT the discoverReaders() method doesn't work on simulator, unless you pass in the simulated: true flag

zameschua avatar Aug 06 '24 08:08 zameschua

@ankitharitus are you still running into issues with discovery?

nazli-stripe avatar Aug 12 '24 22:08 nazli-stripe

@ankitharitus, @nazli-stripe It was also happening with me (trying to integrate with Stripe M2 Reader). I was using ^0.0.1-beta.20 with iOS 17.6.1. Other options like "localMobile" worked correctly.

The problem was related to bluetooth-central permissions in Info.plist.

After adding it, it started working.

brunoambr avatar Aug 30 '24 13:08 brunoambr