我有一个在bluetooth-peripheral模式下运行并等待连接的应用程序。我希望在一个单独的页面上显式触发iOS权限警报对话框,该对话框允许用户授予/恢复权限。(与启动蓝牙服务器时弹出的警报相反)。
如何显式地强制蓝牙外围iOS权限警报弹出(CBPeripheralManagerAuthorizationStatus) ?
发布于 2018-09-11 17:41:29
看来,我可以使用监视蓝牙状态的相同代码请求许可:
func requestBluetoothPermission() {
let showPermissionAlert = 1
let options = [CBCentralManagerOptionShowPowerAlertKey: showPermissionAlert]
bluetoothPeripheralManager = CBPeripheralManager(delegate: self, queue: nil, options: options)
}https://stackoverflow.com/questions/52281137
复制相似问题