2
votes

I'm creating an iOS app that should receive events from a Microsoft Health Band 2, specifically my app is notified when the user taps a button on the band. Everything is paired, communicating, and working great in the foreground.

I run my iOS app, then hit the home button to put it in the background. If I go press the button on the band, my app logs the event to the debug console and sends the event to a server.

However, if I wait a few minutes, then go press the button again with my phone locked, nothing happens. If I foreground the app on my iOS device, all the missing events process at once.

Is it theoretically possible to have a Bluetooth LE accessory wake my app up in response to an irregular event? What would I need to do to get this to work using Core Bluetooth?

It's possible that Microsoft implemented their SDK incorrectly. Is there anything I can do to know whether the problem is on their end or mine?

1

1 Answers

2
votes

Sounds like you have not set the Bluetooth Central Background Execution Mode. If you specify this key in your Info.plist then your app will wake up whenever you receive a callback on the CBPeripheralDelegate or CBCentralManagerDelegate. Both of these delegates are implemented somewhere deep down in the Microsoft SDK.