【问题标题】:Open the Bluetooth Settings Menu in IOS在 IOS 中打开蓝牙设置菜单
【发布时间】:2016-01-13 11:54:28
【问题描述】:

我需要在IOS9.0 中打开蓝牙设置菜单。接下来打开设置菜单OK!,

UIApplication.sharedApplication().openURL(NSURL(string: UIApplicationOpenSettingsURLString)!)

但我需要打开尝试过的蓝牙设置菜单

UIApplication.sharedApplication().openURL(NSURL(string: "prefs:root=General&path=Bluetooth")!)

没有用

谁能帮帮我?

【问题讨论】:

  • 现在我知道该怎么做了。必须包含 Info - URL Types - URL scheme - prefs

标签: ios9 ios-bluetooth


【解决方案1】:

您无法在 iOS 10 中打开蓝牙设置。

这是我打开设置的建议(swift 3)

let url = URL(string: UIApplicationOpenSettingsURLString)!
UIApplication.shared.openURL(url)

【讨论】:

    【解决方案2】:

    路易斯实际上找到了答案,但我一开始就读过去了,因为我没有看到任何答案。

    答案: 转到您的 XCode 项目,在 Info -> URL Types 部分 -> URL Scheme 中的“prefs”

    在IOS9中:let url = NSURL(string: "prefs:root=Bluetooth")!

    IOS8:let url = NSURL(string: "prefs:root=General&path=Bluetooth")!

    【讨论】:

    • 这对我有帮助
    • 它的 prefs:root=蓝牙至少适用于 IOS 8.4
    猜你喜欢
    • 2017-03-24
    • 1970-01-01
    • 2018-05-21
    • 1970-01-01
    • 2015-10-23
    • 1970-01-01
    • 2023-03-28
    • 2016-07-05
    • 2020-12-08
    相关资源
    最近更新 更多