在 xCode/Swift 中,修改字符串 "turn on Bluetooth to Allow [app] to Connect to Accessories"

in xCode/Swift, modify string "turn on Bluetooth to Allow [app] to Connect to Accessories"

我的应用程序需要 BLE(低功耗蓝牙)来检测用户手机之间的距离(因此它不使用 "accessories")。我想修改当用户未在其 iPhone(标题中提到)上启用蓝牙时显示的字符串。

我试过使用 .plist 键 "Privacy - Bluetooth Peripheral Usage Description" 但这不起作用。也已经搜索了互联网。求助!

Apple 定义的键中似乎没有记录字符串:

https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html

另一种方法可能是在尝试使用蓝牙之前检测蓝牙是打开还是关闭,然后首先展示您自己的对话框,向用户解释为什么应用需要许可,即使它并没有真正连接到配件.然后,只有在关闭对话框后,才会触发提示用户的事件。