react-native-ble-manager icon indicating copy to clipboard operation
react-native-ble-manager copied to clipboard

[Question] Can iOS keep bluetooth connection in background mode?

Open riseworld27 opened this issue 4 years ago • 5 comments

I want to know if iOS can keep bluetooth connection in background.

riseworld27 avatar Aug 12 '20 08:08 riseworld27

Yes. It is possible to keep the BLE Connection alive in the background as well. You check out the code and try it out.

SAAHIIIL avatar Aug 26 '20 11:08 SAAHIIIL

@SAAHIIIL Is it supported in this library by default? Could you indicate some part of code to demonstrate background working for BLE?

riseworld27 avatar Aug 26 '20 16:08 riseworld27

Interested also. We have added a listener for BleManagerModule NativeEventEmitter. However, seems like we are not getting any read event when the app goes into background.

willluk avatar Sep 04 '20 08:09 willluk

+1

danielbenedykt avatar Jan 26 '21 14:01 danielbenedykt

@riseworld27 The connection would be alive when in background, but your reads and writes would fail in that case, you would have to do reads and writes when the app is open.

But ble manager does have such methods but you can check this out.

https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html#//apple_ref/doc/uid/TP40013257-CH7-SW10

SAAHIIIL avatar Jan 26 '21 15:01 SAAHIIIL