Unable to navigate to Bluetooth Settings

I have tried below code to open [Settings(App) -> Bluetooth Settings] but it is navigating to App permission screen instead of Bluetooth Settings. I have tried to search but didn't get any latest documentation regarding it. Is there any way to do this?

guard let url = URL(string: UIApplication.openSettingsURLString) else {
            return
        }
        if UIApplication.shared.canOpenURL(url) {
            UIApplication.shared.open(url, options: [:], completionHandler: nil)
        }

Accepted Reply

Thank you @eskimo for your response..Can we navigate the user to the top of the device settings i.e General Settings instead of App permission settings?

Post marked as downvoted Up vote reply of Kanuga_p Down vote reply of Kanuga_p
Post marked as solved

Replies

it is navigating to App permission screen instead of Bluetooth Settings.

Right. That’s what UIApplication.openSettingsURLString is documented to do.

There is no supported way to open Setting > Bluetooth [1].

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] If you search the ’net you’ll find lots of bad advice on this topic. See this post for more about that.

Thank you @eskimo for your response..Can we navigate the user to the top of the device settings i.e General Settings instead of App permission settings?

Post marked as downvoted Up vote reply of Kanuga_p Down vote reply of Kanuga_p
Post marked as solved

What are you trying to enable the user to do? Most things are not possible to navigate directly into the Settings app. Secret apple sauce.

If Bluetooth is off and you want to turn it on AND you're using CoreBluetooth, initialize your manager with the power key. This will trigger a prompt to the user to either enable Bluetooth, or start new connections if that was turned off for the day.

self.centralManager = CBCentralManager(delegate: nil, queue: .main, options: [CBCentralManagerOptionShowPowerAlertKey: true])
  • @edorphy I want to open Bluetooth setting and connect to desired bluetooth device from there. but instead of opening bluetooth setting it's navigating to app settings.

Add a Comment