iOS Health Application Bluetooth Data Transfer - Background Processing Issue

Hello,

Our application is a health application that functions alongside a device transferring data via Bluetooth. There is continuous data transfer happening from this device. However, when operated on an iOS device, the application gets cut off in the background after a certain duration, negatively impacting the user experience.

As is known, the background services of an application being terminated after a certain period is generally associated with how iOS manages system resources. In our case as well, we came across this issue before we implemented a formatted background task. Therefore, to address this situation, we used a formatted background task in our application, but the problem still persists.

Unable to resolve the issue, we decided to analyze how other Bluetooth devices work on iOS devices. For example, when an electronic watch is connected, the Bluetooth connection never gets cut off. However, why can't we achieve the same performance with our device?

I would be extremely grateful if you could shed technical insight on this matter and share your experiences. Furthermore, if you have any recommendations on how to handle such situations, I would love to hear all about them.

Thanks in advance for your help.

Hello,

We have found iOS to be particularly difficult to work with in this regard. There are many use cases for maintaining a BLE connection for streaming data and especially for notifying a server of events. Think about heart rate monitors, security systems, car diagnostics, you name it.

On Android OS, there is no such restriction and seemingly battery life doesn't seem to suffer. Our users love our Android Apps, but on iOS they complain about missing data and lost connections. I just need to tell them it's an iPhone thing and if they want a better experience, until Apple changes this old restriction for BLE / Server connections in the background, to deal with it or move onto an Android phone.

CPU's are incredibly efficient these days so honestly pinging a server over BLE or maintaining a connection in the background between the device and server is actually incredibly resource light.

What's not resource light, is how you can prevent iOS from killing your app...

What we found has worked, is to constantly send characteristic writes every few seconds from the device to the iPhone to keep the BLE connection active and your app awake. You probably can't connect to your server though, incredibly frustrating. This is an unfortunate workaround because, if you think about it, it is actually making the user experience worse and the battery drain (although quite small) more prevalent by keeping the BLE connection more active and not switching to a higher sniff sub rating or longer connection interval.

When you factor in the large ram size of today's iPhones, this issue should really be a non-starter.

iOS Health Application Bluetooth Data Transfer - Background Processing Issue
 
 
Q