2
votes

I am working with the Microsoft Band SDK on iOS and I have a question on restoring connectivity in the background when using the Band SDK. With the Band SDK you connect via Microsoft's API rather than directly to the bluetooth device using Bluetooth Core on iOS. This gets you several events including device connected, device disconnected, etc.

The problem I am having is how to restore a connection if the device disconnects, such as going out of range. I would like to be able to restore the connection when my app is in the background without having to bring the app back to the foreground. I have added the bluetooth background modes to my Info.plist, which allows me to process events from the device in the background but any attempt I make from the background to restore the connection never seems to complete until I bring the app to the foreground.

All the documentation on state preservation with Core Bluetooth seems to only apply if I am managing the device myself using the CBCentralManager, however since I am using Microsoft's Band SDK as an intermediary I don't believe I can use this.

So any help on how I can restore the connection via the Band SDK API while my app is in the background would be appreciated. I know the correct API calls to make I'm just unsure how/if they can succeed while my app is in the background.

1

1 Answers

0
votes

Direct access to the Band via Core Bluetooth is not supported for 3rd party apps. So, managing the Band from CBCentralManager will not be possible from your app.