11
votes

I wish to keep scanning for Bluetooth Devices and I want app to be alive in the background. Is it possible? It seems like if I have a connected Bluetooth device, and if there is data transfer, then the app stays awake in the background. However, if I am just scanning in the background, it seems like even if I have Uses Bluetooth LE accessories checked(bluetooth-central in plist), the app ends up not running.

Is there a way to keep the app alive and continuous scan for devices when it is in the background?

1

1 Answers

2
votes

As per apple developer documentation technical Q&A.

Can I use an iOS device to issue iBeacon advertisements while my app is in the background? Answer: No. For an iOS device to issue iBeacon advertisements, the app requesting this functionality must be frontmost, with the screen turned on and the device unlocked.

Reference - https://developer.apple.com/ibeacon/Getting-Started-with-iBeacon.pdf

I found this article which provides some details to connect BLE in background for some specific case. https://medium.com/@cbartel/ios-scan-and-connect-to-a-ble-peripheral-in-the-background-731f960d520d