Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 818 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to open settings app programmatically?

#1
I'm using swift with ios 8.3. I want to open settings app from my application. I know that using the code

UIApplication.sharedApplication().openURL(NSURL(string: UIApplicationOpenSettingsURLString)!)
will open my app settings. But I don't want to open my app settings. I just want to open the settings app and stay in the main page. If possible, navigate to "Cellular". Is there any way to acheive this?
Reply

#2
Xcode 14:
you can do:

// System settings:
let url = URL(string: UIApplication.openSettingsURLString)!
UIApplication.shared.open(url)

// Notifications settings:
URL(string: UIApplication.openNotificationSettingsURLString)!
UIApplication.shared.open(url)
Reply

#3
Try this.

if let appSettings = URL(string: UIApplication.openSettingsURLString) {
UIApplication.shared.open(appSettings, options: [:], completionHandler: nil)
}

Xcode 11.5 - iOS > 10
Reply

#4
YES, They made changes in iOS 10, Please change "prefs:" to "App-Prefs:"

```swift
guard let profileUrl = URL(string:"App-Prefs:root=General&path=ManagedConfigurationList") else {
return
}

if UIApplication.shared.canOpenURL(profileUrl) {
UIApplication.shared.open(profileUrl, completionHandler: { (success) in
print(" Profile Settings opened: \(success)")
})
}
Reply

#5
**Update on 11-Oct-2016:**

It won't work in iOS10 anymore. So far I haven't found any workaround. If you guys have any solution please let me know. thanks.

======================================

if the iOS version <= iOS9, you need set URL types:
[![enter image description here][1]][1]

You can do in this way:

let url:NSURL! = NSURL(string : "prefs:root=")
UIApplication.sharedApplication().openURL(url)

I have a demo on github:

[To see links please register here]


And you can find all available URLs as follows:

[To see links please register here]

Preferences app registers a private URL scheme, prefs:, the list below details opening specific views [1][2]


prefs:root=General&path=About
prefs:root=General&path=ACCESSIBILITY
prefs:root=AIRPLANE_MODE
prefs:root=General&path=AUTOLOCK
prefs:root=General&path=USAGE/CELLULAR_USAGE
prefs:root=General&path=Bluetooth
prefs:root=General&path=DATE_AND_TIME
prefs:root=FACETIME
prefs:root=General
prefs:root=General&path=Keyboard
prefs:root=CASTLE
prefs:root=CASTLE&path=STORAGE_AND_BACKUP
prefs:root=General&path=INTERNATIONAL
prefs:root=LOCATION_SERVICES
prefs:root=ACCOUNT_SETTINGS
prefs:root=MUSIC
prefs:root=MUSIC&path=EQ
prefs:root=MUSIC&path=VolumeLimit
prefs:root=General&path=Network
prefs:root=NIKE_PLUS_IPOD
prefs:root=NOTES
prefs:root=NOTIFICATIONS_ID
prefs:root=Phone
prefs:root=Photos
prefs:root=General&path=ManagedConfigurationList
prefs:root=General&path=Reset
prefs:root=Sounds&path=Ringtone
prefs:root=Safari
prefs:root=General&path=Assistant
prefs:root=Sounds
prefs:root=General&path=SOFTWARE_UPDATE_LINK
prefs:root=STORE
prefs:root=TWITTER
prefs:root=General&path=USAGE
prefs:root=VIDEO
prefs:root=General&path=Network/VPN
prefs:root=Wallpaper
prefs:root=WIFI
prefs:root=INTERNET_TETHERING

hope this helpful to you.


[1]:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through