ios - CoreBluetooth didDiscoverPeripheral not being called when phone is locked -


i have ios app (swift) reacts custom ble device. device sends message 5 seconds when being clicked. app scans service , not connect device. working fine when app in foreground or in background, not when phone being locked (power button pushed). worked fine before (before ios 10).

code snippets:

// init centralmanager centralmanager = cbcentralmanager(delegate: self, queue: dispatch_get_global_queue(qos_class_background, 0))  ...  // in centralmanagerdidupdatestate let arrayofservices: [cbuuid] = [cbuuid(string:"0000****-0000-1000-8000-0080********")] self.centralmanager?.scanforperipheralswithservices(arrayofservices, options: [cbcentralmanagerscanoptionallowduplicateskey: false]) 

i enabled background modes: uses bluetooth le accessories. , have bluetooth-central in .plist uibackgroundmodes.

i've read stackoverflow posts deal problems alike , tried if solutions worked me. haven't found useful regarding problem in apple documentation either. tried example:

  • cbcentralmanager queue nil / mainqueue

  • scanforperipheralswithservices(nil , , different options)

anyone know workaround problem can work used to? or know of change in ios 10 prevents working?


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -