swift2 - swift background BLE scanning with scanForPeripheralsWithServices UUID not taken into account -
i'm performing ble devices scan in specific thread. if want app run in background, need specify scanforperipheralswithservices specific range of services.
when launching following (with nil) :
func startscanning() { print("start scanning...") if let central = centralmanager { central.scanforperipheralswithservices(nil, options: nil) } }
i can find ble device uuid "b737d0e7-af53-9b83-e5d2-922140a92e00", apple documentation mentioned cannot ruined in background mode.
then if specify uuid function:
func startscanning() { print("start scanning...") if let central = centralmanager { let ble = [cbuuid(string: "b737d0e7-af53-9b83-e5d2-922140a92e00")] central.scanforperipheralswithservices(ble, options: nil) } }
scan never called. miss ?
Comments
Post a Comment