This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

[HID] - Background BLE connection iOS

Hello Fellow developer,

I go a BLE product that is linked to an Android and iOS APP.

The main use case of the product is to be used without touching the phone (while the phone is locked and app running on background).

So our current app is taking care of scanning and managing the BLE connection. Our BLE device do not perfom pairing and do not contain any service like HID.

So if we scan BLE devices with the iOS settings directly, we don't see the device, Howerver within the app it's working fine.

We do have connection lost in a certain case for example if the app has been in background without any device connected to it (24H for example) or if we Turn ON/OFF the plane mode. Then at that moment, the app will be unable to reconnect to our device (doing advertising), the only way to connect again to the device is to bring back the app on the foreground.

Now I tried to add a HID service in that button so the BLE connection is managed directly by the OS and not through the APP only.

It seems to improve a lot the stability of the BLE connection and I notice that lot of BLE button is using the HID service as well.

Now My questions where I cannot really find a clear answer is:

Is it normal that If I manage my BLE connection within my APP on iOS that the OS will stop my APP working after a while (without pairing and only custom service)?

Is it true that integrate HID service and pairing and so manage the BLE connection through the OS directly and not the APP will have a huge impact on the BLE connection quality especially everything around the RE-Connection management ?

Thanks for your help

Related