問題有關iOS6的外圍藍牙連接。如何獲得在iOS6的藍牙隱私設置狀態
在info.plist中如果我添加UIBackgroundModes藍牙外設,在應用程序啓動,它要求第一時間許可。
「APPNAME」想提供給附近的藍牙設備上的數據,即使你不使用的應用程序
如果我否認(不容許)的要求,設置 - 隱私 - 藍牙共享 - 「Appname」轉爲「OFF」;
我設置爲監聽CBPeripheralManagerDelegate,看看我是否可以,但它總是返回「ON」即使我拒絕請求。 (這也是有道理的,因爲它是「開」之前被切換到後臺)
- (void)peripheralManagerDidUpdateState:(CBPeripheralManager *)peripheral{
NSLog(@"%s",__func__);
NSLog(@"%@",[peripheral description]);
NSString *state = nil;
switch (peripheral.state) {
case CBPeripheralManagerStateResetting:
state = @"resetting"; break;
case CBPeripheralManagerStateUnsupported:
state = @"unsupported"; break;
case CBPeripheralManagerStateUnauthorized:
state = @"unauthorized"; break;
case CBPeripheralManagerStatePoweredOff:
state = @"off"; break;
case CBPeripheralManagerStatePoweredOn:
state = @"on"; break;
default:
state = @"unknown"; break;
}
NSLog(@"peripheralManagerDidUpdateState:%@ to %@ (%d)", peripheral, state, peripheral.state);
}
我看到CBPeripheralManagerStateUnauthorized看起來顯示否認的狀態,但即使我拒絕請求我不能讓這種狀況。
的問題是: 「有什麼辦法,我可以找出用戶拒絕後臺接入的要求嗎?」
謝謝。我一直在尋找iOS 6時代,但它終於在iOS 7上實現了。 –