react-native-bluetooth-classic icon indicating copy to clipboard operation
react-native-bluetooth-classic copied to clipboard

How to start discovery devices in IOS?

Open HudsonJunior opened this issue 3 years ago • 4 comments

I noticed that the method startDiscovery is available only for Android. Is there any other function in IOS that do the same thing? Or in IOS I only can search for paired/connected devices?

HudsonJunior avatar Jun 15 '21 18:06 HudsonJunior

Negative, the MFi protocol does not support the scanning feature. The functionality may be available in the CoreBluetooth library in later versions of IOS, but I haven't had a chance to look into it much more. If you feel like you get something working, feel free to submit a pull request with everything documented.

kenjdavidson avatar Jun 15 '21 19:06 kenjdavidson

Sorry, closed by accident. I'll leave open for further discussion for a bit if you want to look into it.

kenjdavidson avatar Jun 15 '21 19:06 kenjdavidson

Here is a sample project showing how to use Core Bluetooth with 'Classic' although I don't believe this covers RFCOMM which this library is primarily for. The library already uses Core Bluetooth to determine whether bluetooth is enabled, so I'm not against pulling some features in that make sense - but there are super strict requirements to the MFi protocol that I'd prefer to stick to - ie I don't want this becoming a BLE library by chance (although it's more than likely using manual implementation of the Module and connections.

https://developer.apple.com/documentation/corebluetooth/using_core_bluetooth_classic

kenjdavidson avatar Jun 15 '21 19:06 kenjdavidson

Ok. Thanks for the feedback.

HudsonJunior avatar Jun 16 '21 11:06 HudsonJunior

It looks like CoreBluetooth still doesn't support this. At this point I'm going to leave it as a known issue between Android and IOS. IOS controls a number of things internally which we just don't have access to using the EAAccessory library.

kenjdavidson avatar Sep 26 '22 13:09 kenjdavidson