0

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.

izik461
  • 1,131
  • 12
  • 32
  • I get background notifications after updating my device to iOS 8.1. Could your issue be related to State Preservation and Restoration? – Maria Nov 13 '14 at 09:15

1 Answers1

3

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!

izik461
  • 1,131
  • 12
  • 32
  • WOW you saved me from a few days of banging my head! THANK YOU!! I had a static method initializing the bluetooth manager, but was too early and moved it to `ApplicationDidFinishLaunchingWithOptions` and background mode started working. THANK YOU THANK YOU!! – TruMan1 Sep 27 '16 at 12:27