How to turn on wifi or bluetooth using a button in my app

I would like to know, do we have any support from iOS in order to turn on wifi and bluetooth using internal apis on tap of a button in my IOS App, I am struggling to find information over this, more precisely , I want to turn on wifi from my custom widget in I phone, is it possible then please share info.

Replies

I doubt this is possible. Imagine some nefarious app gets installed that does something nasty like turning off your Wi-Fi, Bluetooth, Mobile Data etc. Would you want that?

Even the Shortcuts app doesn't let you do that.

You can't even force iOS to do something benign like switching to Dark Mode etc. because why should an app have control over such a system setting that affects lots of other things?

is it possible

No.

There’s no supported way for an iOS app to enable or disable Wi-Fi. TN3111 iOS Wi-Fi API overview has a summary of the Wi-Fi APIs that are available on iOS.

Likewise for Bluetooth.

Share and Enjoy

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