I want to open WIFI setting section from my iOS application, my code was working well before Swift 3 with iOS 9.2
if let settingsURL = URL(string: AppSettingsWifiUrl) {
UIApplication.shared.openURL(settingsURL)
}
But after updating it is not working with Xcode 8 + Swift 3 + iOS 10, can anybody help here?
Just use:
This thing will work with iOS 10 also but you have to add URL types in ur project setting info. URL schemes should be prefs If you need I will share the screen shot so that you can easily achieve.
Thanks
We can't do this anymore on iOS 11, we can just open the settings :
Use the following for iOS 10 and above:
iOS 9+
You can't directly open the Wi-Fi settings tab from your app. You are just allowed to open the settings app in general.
The following code works with
Swift 4
+iOS 9+
:Source: Apple developer documentation
open
andopenURL
It was actually possible in
iOS 9
to open the Wi-Fi settings tab directly (using private API URL schemes) but this was considered as bug usage.Therefore: Don't use
App-Prefs:root
orpref:root
URL schemes as they will lead to rejection of your app by Apple's review check.Source: Apple developer forum post from Apple's eskimo.
iOS 11+
If you need to connect to a certain Wi-Fi network
NEHotspotConfigurationManager
maybe helps.Source: Apple technical Q&A QA1942