Is there a way to toggle wifi on and off programatically in iOS?
I done it for Bluetooth using the code on this link:
Is there a way to toggle bluetooth and/or wifi on and off programmatically in iOS?
But I couldn’t figure out how to do the same for Wifi. How do you switch the Wifi on/off? Is it possible ?
3 Solutions Collect From Internet About “Is there a way to toggle wifi on and off programatically in iOS?”
In iOs 2.x you can use some private API to do this, however it does not work in iOS4.x, 5.x. Hope that Apple will public the API for manage Wifi, now it is only used by Setting apple app.
It’s definitely not possible to turn WiFi off or on with any public (documented) API.
It might be possible to achieve this even on a non-jailbroken device using private functions.
See Apple80211Functions – there is a private function called
Apple80211SetPower which is a good candidate for this job. But using it would be also interfering with automatic TX power settings – could result in either increased battery usage or decreased WiFi link quality (or both).
Of course your app would most definitely not pass App Store approval using this.
You can see how Apple80211 functions can be used if you download Stumbler source.
Stumbler SVN checkout is done by:
svn checkout http://iphone-wireless.googlecode.com/svn/trunk/ iphone-wireless-read-only
There are also two other projects that might help you start with low-level WiFi functions:
I’m fairly certain that the SDK does not allow access to turning Wifi on or off using the public framework, sorry. You could use a private framework but then you won’t get your app past Apple, I suspect.
- Is it possible to change the title of PKAddPassesViewController ?
- Correct use of format specifier to show up to three decimals if needed, otherwise zero decimals?
- Where to set environment variables for app?
- Objective C – respondsToSelector for dynamic properties
- Add a ContainerView inside a UIViewController created from .xib
- Return CATransform3D to map quadrilateral to quadrilateral
- ASIHTTPRequest request times out
- Strategy to perform many Geocode requests
- How to programatically install a ipa file in iOS 6
- When install build from xcode push notification is working but when install ipa it is not working
- iPhone/Xcode: can different project targets have different bundle identifiers?
- Unexpectedly found nil while unwrapping an Optional value swift
- Error Your account already has a valid iOS Distribution certificate
- Putting a video to pause state before playing
- How do you load custom UITableViewCells from Xib files?