izik461
izik461

Reputation: 1173

BLE background mode in iOS 8.1

I've been working on application that receives health data trough BLE. It's been working correctly in background and sending the notification when in specific conditions. Problems, unfortunately, occured when I installed the iOS 8.1. It doesn't trigger peripheral:didUpdateValueForCharacteristic while in background. When I go with the app back to foreground - it receives data correctly.

In Info.plist -> UIBackgroundModes bluetooth-central is added.

My tests shown, that in 8.0 it was still working.

Upvotes: 0

Views: 795

Answers (1)

izik461
izik461

Reputation: 1173

I've created my bluetoothManager to be used within the AppDelegate.sharedInstance.

Initialisation of BLEManager was made in AppDelegate in init and should be done in ApplicationDidFinishLaunchingWithOptions.

After moving its initialization it started working. iOS behaviour is sometimes unknown. Better init your managers when app is loaded and ready to go!

Upvotes: 3

Related Questions