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

标签 ios xcode swift bluetooth ibeacon

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

我曾尝试使用 .plist key “隐私 - 蓝牙外围设备使用说明”,但这不起作用。也已经搜索了互联网。帮助!

最佳答案

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

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

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

关于ios - 在 xCode/Swift 中,修改字符串 "turn on Bluetooth to Allow [app] to Connect to Accessories",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34486438/

相关文章:

iOS NSFetchedResultsController 类似 Realm 版本 2.1 的类

ios - UITableViewController 背景色

ios - 使用滑动手势更改 View

ios - UITableViewCell 自定义类和 UITableView 滚动问题

swift - removeSubrange 产生 '()' ,而不是预期的上下文结果类型 'String'

ios - 通过访问 AppDelegate 中的 Tab Bar Items 更改 Tab Bar Item Image inset

ios - 持续时间导致访问错误问题的 UIView 动画

ios - Xcode 8 中的 UITabbarController 在 Storyboard View 中显示了一个蓝色矩形

iPhone 在连接到 Mac 时显示问号(代替其图标)

iOS Xcode 4 UINavigationController