Questions tagged [ble-state-preservation]

8 questions
18
votes
0 answers

Unable to trigger state restoration code for BLE on iOS

I am trying to get my app to respond relaunch into the background is response to discovering an advertising peripheral. The following code currently works in my app (in foreground + background, even after many hours of being…
wheresmycookie
  • 683
  • 3
  • 16
  • 39
11
votes
2 answers

How to trigger Core Bluetooth state preservation and restoration

State Preservation and Restoration Because state preservation and restoration is built in to Core Bluetooth, your app can opt in to this feature to ask the system to preserve the state of your app’s central and peripheral managers and to…
mm24
  • 9,280
  • 12
  • 75
  • 170
3
votes
1 answer

protectedDataAvailable always true

From what I understand, UIApplication.sharedApplication().protectedDataAvailable should return false when the phone is locked and protected data is enabled on the iPhone (apparently setting a passcode enables it). However, despite of the scenario,…
2
votes
1 answer

CoreBluetooth state preservation: correct way to restore CBCentralManager

what is the correct way to restore the CBCentralManager from AppDelegate when the App gets lunched with options due to a state preservation event? - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary…
mm24
  • 9,280
  • 12
  • 75
  • 170
1
vote
1 answer

Since I activated BLE State preservation my app drains all the battery

I got an app that is connected to a BLE peripheral. It implements state-preservation and restoration for BLE and keeps the connection in background. When I leave the phone next to the peripheral the peripheral shows that there is an active…
mm24
  • 9,280
  • 12
  • 75
  • 170
1
vote
0 answers

Is there a way to accurately measure the impact of "Bluetooth state preservation" on an app energy usage?

I would like to monitor the energy usage granularly and measure the impact of Bluetooth State preservation and restoration for background processing in iOS. I'd like to measure the impact of iOS keeping "the" connection active to a Bluetooth…
mm24
  • 9,280
  • 12
  • 75
  • 170
1
vote
0 answers

Core Bluetooth State Preservation and restoration not working properly

I have followed the state preservation and restoration in the wwdc video - https://developer.apple.com/videos/play/wwdc2013/703/ The issue Im having is that after the app is closed by the OS, when the BLE device goes out of range. The OS doesn't…
user2636368
  • 622
  • 4
  • 10
  • 20
0
votes
0 answers

Bluetooth BLE state preservation: CBCentralManager won't discover services whilst in background

EDIT: Following @RobertVaessen comment I implemented the following, however I am still unable to discover the services of the connected peripheral. -(void) centralManager:(CBCentralManager *)central willRestoreState:(NSDictionary
mm24
  • 9,280
  • 12
  • 75
  • 170