Closed woflmao closed 1 year ago
From my understanding there are a bunch of issues related to Bluetooth and Expo. There was a secondary/addon library documented in order to get it working https://kenjdavidson.com/react-native-bluetooth-classic/expo/ you'll need to look into that. I don't do much Mobile development anymore, and I've never used Expo, so this is out of my realm.
Also, have you followed all the required functionality for IOS, ie. MFi protocol strings? This may be compiling on Expo but failing here instead of at the protocol setting portion.
Yes I have the MFi protocol string in the expo plugins "with-rn-bluetooth-classic" section, thanks for the quick response though I will do some more research!
Can you email me the protocols? What's the device?
The error implies that the native module isn't loading. Have you tired ejecting and doing locally?
Following up for those that may come across this issue. It looks like the IOS side of things is not auto-linking the native module. @woflmao is going to attempt to:
Chances are that React Native changed how Auto linking of native modules works, I recently read something in 0.70 version about native modules being changed. If this is the case, I'll attempt to break off:
0.64.x-rcY
to maintain lower version0.70.x-rcY
to start looking at fixing how React native manages native modules.PRs will be appreciated if so.
Update: The steps shared by @kenjdavidson above did work to solve this issue. Thanks again for all the help.
Glad you got it working, thanks!
@woflmao I am having the same issue. I am using Expo managed workflow with dev client. Do you have an idea about what I need to do to fix the issue? I am actually experiencing the issue with Android as well.
If you're seeing the issue in both Android and IOS then you're most likely not using the with-rn-bluetooth-classic
plugin appropriately and therefore the module/library isn't getting installed. You'll need to follow those steps to make sure the module is loaded correctly.
Mobile Device Environment Provide a list of operating systems on which this issue is relevant.
Application Environment Provide information about your development environment:
Describe the bug Android worked fine, when I switched Expo to build ios, I am getting "Cannot read property 'getBondedDevices' of null" when attempting to use RNBluetoothClassic.getBondedDevices(). Upon logging RNBluetoothClassic I get this result:
As opposed to the same call on Android which produces this:
To Reproduce Steps to reproduce the behavior:
Expected behavior Expect to return a list of bonded devices