Open ezrover opened 7 years ago
This API misuse warning is unavoidable because the Nearby Messages library supports both foreground and background BLE scanning/advertising, and therefore implements the centralManager:willRestoreState: method. Apps that don't enable BLE background mode will unfortunately see this error.
`messageMgr = GNSMessageManager(apiKey: "ccc", paramsBlock: {(params: GNSMessageManagerParams!) -> Void in }) GNSMessageManager.setDebugLoggingEnabled(true) GNSPermission.setGranted(true) nearbyPermission = GNSPermission(changedHandler: { [unowned self] (granted: Bool) in if granted { guard let mgr = self.messageMgr else { return } self.subscription = mgr.subscription(messageFoundHandler: { (message: GNSMessage?) in print ("Received: (String(describing: message))}") if UIApplication.shared.applicationState != .active { let notification = UNMutableNotificationContent() notification.title = "Received: (String(describing: message))" notification.subtitle = "iD" notification.body = "Welcome"
Results in CoreBluetooth Error:
Beacon: Start scanning 2017-05-06 22:22:11.200389-0700 s[421:40712] Transmitting 2017-05-06 22:22:11.203035-0700 s[421:40712] Publish (mediums: 2, broadcast/scan: 3, beacons: 0/0/0, background: 0) 2017-05-06 22:22:11.205965-0700 s[421:40652] [CoreBluetooth] API MISUSE: <CBCentralManager: 0x17426e7c0> has no restore identifier but the delegate implements the centralManager:willRestoreState: method. Restoring will not be supported 2017-05-06 22:22:11.208803-0700 s[421:40712] Beacon: Start scanning 2017-05-06 22:22:11.231810-0700 s[421:40712] [CoreBluetooth] API MISUSE: <CBCentralManager: 0x170466880> has no restore identifier but the delegate implements the centralManager:willRestoreState: method. Restoring will not be supported