作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在我的项目中使用 Core Bluetooth 并且一切正常,但是当我的设备上的蓝牙被禁用时,我会收到一 strip 有文本 LE_POWER_OFF_HEADER
的警报并且使用按钮“设置”和“取消”。 我想更改文本和语言。
这似乎是默认警报,我无法更改它。
当中央状态为 poweredOff
时,警报就会弹出。我使用这个函数来检查 Central Manager 的状态:
- (void)centralManagerDidUpdateState:(CBCentralManager *)central{
NSString *messtoshow;
switch (central.state) {
case CBCentralManagerStateUnknown:
{
messtoshow=[NSString stringWithFormat:@"State unknown, update imminent."];
break;
}
case CBCentralManagerStateResetting:
{
messtoshow=[NSString stringWithFormat:@"The connection with the system service was momentarily lost, update imminent."];
break;
}
case CBCentralManagerStateUnsupported:
{
messtoshow=[NSString stringWithFormat:@"The platform doesn't support Bluetooth Low Energy"];
break;
}
case CBCentralManagerStateUnauthorized:
{
messtoshow=[NSString stringWithFormat:@"The app is not authorized to use Bluetooth Low Energy"];
break;
}
case CBCentralManagerStatePoweredOff:
{
messtoshow=[NSString stringWithFormat:@"Bluetooth is currently powered off."];
break;
}
case CBCentralManagerStatePoweredOn:
{
messtoshow=[NSString stringWithFormat:@"Bluetooth is currently powered on and available to use."];
[mgr scanForPeripheralsWithServices:[NSArray arrayWithObject:[CBUUID UUIDWithString:@"180D"]] options:nil];
[mgr retrieveConnectedPeripherals];
//--- it works, I Do get in this area!
break;
}
}
NSLog(messtoshow); }
最佳答案
尝试使用设备,您将获得本地化语言的正确消息。
关于iphone - LE_POWER_OFF_HEADER 默认警报使用 CoreBluetooth,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16561749/
我在我的项目中使用 Core Bluetooth 并且一切正常,但是当我的设备上的蓝牙被禁用时,我会收到一 strip 有文本 LE_POWER_OFF_HEADER 的警报并且使用按钮“设置”和“取
我是一名优秀的程序员,十分优秀!