Is there a way to toggle bluetooth and/or wifi on and off programatically in iOS?

Posted by Andy W on Stack Overflow See other posts from Stack Overflow or by Andy W
Published on 2010-12-23T11:39:55Z Indexed on 2010/12/23 11:54 UTC
Read the original article Hit count: 272

Filed under:
|
|
|

I am looking for an easy way to toggle both bluetooth and wifi between on and off states on iOS 4.x devices (iPhone and iPad).

I am constantly toggling these functions as I move between different locations and usage scenarios, and right now it takes multiple taps and visits to the Settings App. I am looking to create a simple App, that lives on Springboard, that I can just tap and it will turn off the wifi if it's on, and vice versa, then immediately quit. Similarly with an App for toggling bluetooth’s state.

I have the developer SDK, and am comfortable in Xcode and with iOS development, so am happy to write the required Xcode to create the App. I am just at a loss as to which API, private or not, has the required functionality to simply toggle the state of these facilities.

Because this is scratching a very personal itch, I have no intent to try and sell the App or get it up on the App store, so conforming with App guidelines on API usage is a non-issue. What I don’t want to do is jailbreak the devices, as I want to keep the core software as shipped.

Can anyone point me at some sample code or more info on achieving this goal, as my Google-fu is letting me down, and if the information is out there for 4.x devices I just can’t find it.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about ios