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
104 stars 50 forks source link

App crashing when using discoverReaders method. #751

Open ankitharitus opened 2 months ago

ankitharitus commented 2 months ago

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

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

nabilfreeman commented 2 months ago

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)

ankitharitus commented 2 months ago

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

DaviddStewarttCT commented 1 month ago

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

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

and it completely crashes my application

zameschua commented 1 month ago

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

nazli-stripe commented 1 month ago

@ankitharitus are you still running into issues with discovery?

brunoambr commented 2 weeks ago

@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.