Permission icon indicating copy to clipboard operation
Permission copied to clipboard

Bluetooth permission on IOS<13

Open aviya-smila opened this issue 4 years ago • 1 comments

I have an issue with IOS pre 13, the callback for permission.request isn't being called. is there a way to callback with authorized automatically?

aviya-smila avatar Sep 08 '20 12:09 aviya-smila

I don't think callback works for Bluetooth permission authorization change. I suggest you check the authorization status in viewDidLoad for your action or use UIApplication.didBecomeActiveNotification key with NotificationCenter. Or this might answer your question: Replace code in Bluetooth.swift if #available(iOS 13.0, *) { switch CBCentralManager().authorization { case .restricted: return .disabled case .denied: return .denied case .notDetermined, .allowedAlways: break @unknown default: return .notDetermined } } else { switch CBPeripheralManager.authorizationStatus() { case .restricted: return .disabled case .denied: return .denied case .notDetermined, .authorized: break @unknown default: return .notDetermined } }

kaiserabliz avatar Sep 08 '20 15:09 kaiserabliz