gpt4 book ai didi

iphone - LE_POWER_OFF_HEADER 默认警报使用 CoreBluetooth

转载 作者:行者123 更新时间:2023-11-29 13:13:25 26 4
gpt4 key购买 nike

我在我的项目中使用 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com