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:
  • 464 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Opening the Settings app from another app

#11
Tested with iOS 10. Working




NSArray* urlStrings = @[@"prefs:root=WIFI", @"App-Prefs:root=WIFI"];
for(NSString* urlString in urlStrings){
NSURL* url = [NSURL URLWithString:urlString];
if([[UIApplication sharedApplication] canOpenURL:url]){
[[UIApplication sharedApplication] openURL:url];
break;
}
}









Happy Coding :)
Reply

#12
**SWIFT 4.0**
> 'openURL' was deprecated in iOS 10.0: Please use
> openURL:options:completionHandler: instead



UIApplication.shared.open(URL.init(string: UIApplicationOpenSettingsURLString)! , options: [:], completionHandler: nil)
Reply

#13
***Swift 4***

I prefer to open setting in a safer way,

if let settingUrl = URL(string:UIApplicationOpenSettingsURLString) {

UIApplication.shared.open(settingUrl)
}
else {
print("Setting URL invalid")
}
Reply

#14
From [@Yatheeshaless][1]'s [answer][2]:

You can open settings app programmatically in iOS8, but not in earlier versions of iOS.

**Swift:**

UIApplication.sharedApplication().openURL(NSURL(string:UIApplicationOpenSettingsURLString)!)

**Swift 4:**

if let url = NSURL(string: UIApplicationOpenSettingsURLString) as URL? {
UIApplication.shared.openURL(url)
}

**Swift 4.2 (BETA):**

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



**Objective-C:**

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];

[1]:

[To see links please register here]

[2]:

[To see links please register here]


Reply

#15
**YES!!** you can launch Device Settings screen, I have **tested on iOS 9.2**

**Step 1.** we need to add URL schemes

Go to Project settings --> Info --> URL Types --> Add New URL Schemes

[![enter image description here][1]][1]

**Step 2.** Launch Settings programmatically Thanks to [@davidcann][2]

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs://"]];

Also we can launch sub-screens like Music, Location etc. as well by just using proper name

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=MUSIC"]];

See this full name list [**here**][3] shared by Henri Normak

-----

**Update:**

**As per the comment everyone wants to know what happens after this change to my application submission status?**

So `YES!! I got successful update submission and application is available on store without any complain.`

Just to confirm,
I Just downloaded this morning and disabled Location services, and then started the app, which asked me for location permission and then my alert popup was there to send me on settings -> location services page --> Enabled --> That's it!!



***[![NOTICE:
Your app might be rejected ... even if it's approved it can be rejected in future version if you use this method...][4]][4]***


[1]:

[2]:

[To see links please register here]

[3]:

[To see links please register here]

[4]:
Reply

#16
To add to accepted answer: (from apple developer documentation) "When you open the URL built from this string (openSettingsURLString), the system launches the Settings app and displays the app’s custom settings, if it has any." So, if you want to open settings for your app, create your own Settings.bundle.
Reply

#17
Seems like you can use the `prefs:<area>` URL to open the settings and go to specific areas. Apple could change these and break your app so always check if you can open them first.

From this [article][1] they have listed some of them for iOS 13.1:

**Settings URLs**


**iCloud**

- iCloud: `prefs:root=CASTLE`
- iCloud Backup: `prefs:root=CASTLE&path=BACKUP`

**Wireless Radios**

- Wi-Fi: `prefs:root=WIFI`
- Bluetooth: `prefs:root=Bluetooth`
- Cellular: `prefs:root=MOBILE_DATA_SETTINGS_ID`

**Personal Hotspot**

- Personal Hotspot: `prefs:root=INTERNET_TETHERING`
- Personal Hotspot ⇾ Family Sharing: `prefs:root=INTERNET_TETHERING&path=Family%20Sharing`
- Personal Hotspot ⇾ Wi-Fi Password: `prefs:root=INTERNET_TETHERING&path=Wi-Fi%20Password`

**VPN**

- VPN: `prefs:root=General&path=VPN`

**Notifications**

- Notifications: `prefs:root=NOTIFICATIONS_ID`
- Notifications ⇾ Siri Suggestions: `prefs:root=NOTIFICATIONS_ID&path=Siri%20Suggestions`

**Sounds**

- Sounds: `prefs:root=Sounds`
- Ringtone: `prefs:root=Sounds&path=Ringtone`

**Do Not Disturb**

- Do Not Disturb: `prefs:root=DO_NOT_DISTURB`
- Do Not Disturb ⇾ Allow Calls From: `prefs:root=DO_NOT_DISTURB&path=Allow%20Calls%20From`

**Screen Time**

- Screen Time: `prefs:root=SCREEN_TIME`
- Screen Time ⇾ Downtime: `prefs:root=SCREEN_TIME&path=DOWNTIME`
- Screen Time ⇾ App Limits: `prefs:root=SCREEN_TIME&path=APP_LIMITS`
- Screen Time ⇾ Always Allowed: `prefs:root=SCREEN_TIME&path=ALWAYS_ALLOWED`

**General**

- General: `prefs:root=General`
- General ⇾ About: `prefs:root=General&path=About`
- General ⇾ Software Update: `prefs:root=General&path=SOFTWARE_UPDATE_LINK`
- General ⇾ CarPlay: `prefs:root=General&path=CARPLAY`
- General ⇾ Background App Refresh: `prefs:root=General&path=AUTO_CONTENT_DOWNLOAD`
- General ⇾ Multitasking (iPad-only): `prefs:root=General&path=MULTITASKING`
- General ⇾ Date & Time: `prefs:root=General&path=DATE_AND_TIME`
- General ⇾ Keyboard: `prefs:root=General&path=Keyboard`
- General ⇾ Keyboard ⇾ Keyboards: `prefs:root=General&path=Keyboard/KEYBOARDS`
- General ⇾ Keyboard ⇾ Hardware Keyboard: `prefs:root=General&path=Keyboard/Hardware%20Keyboard`
- General ⇾ Keyboard ⇾ Text Replacement: `prefs:root=General&path=Keyboard/USER_DICTIONARY`
- General ⇾ Keyboard ⇾ One Handed Keyboard: `prefs:root=General&path=Keyboard/ReachableKeyboard`
- General ⇾ Language & Region: `prefs:root=General&path=INTERNATIONAL`
- General ⇾ Dictionary: `prefs:root=General&path=DICTIONARY`
- General ⇾ Profiles: `prefs:root=General&path=ManagedConfigurationList`
- General ⇾ Reset: `prefs:root=General&path=Reset`

**Control Center**

- Control Center: `prefs:root=ControlCenter`
- Control Center ⇾ Customize Controls: `prefs:root=ControlCenter&path=CUSTOMIZE_CONTROLS`

**Display**

- Display: `prefs:root=DISPLAY`
- Display ⇾ Auto Lock: `prefs:root=DISPLAY&path=AUTOLOCK`
- Display ⇾ Text Size: `prefs:root=DISPLAY&path=TEXT_SIZE`

**Accessibility**

- Accessibility: `prefs:root=ACCESSIBILITY`

**Wallpaper**

- Wallpaper: `prefs:root=Wallpaper`

**Siri**

- Siri: `prefs:root=SIRI`

**Apple Pencil**

- Apple Pencil (iPad-only): `prefs:root=Pencil`

**Face ID**

- Face ID: `prefs:root=PASSCODE`

**Emergency SOS**

- Emergency SOS: `prefs:root=EMERGENCY_SOS`

**Battery**

- Battery: `prefs:root=BATTERY_USAGE`
- Battery ⇾ Battery Health (iPhone-only): `prefs:root=BATTERY_USAGE&path=BATTERY_HEALTH`

**Privacy**

- Privacy: `prefs:root=Privacy`
- Privacy ⇾ Location Services: `prefs:root=Privacy&path=LOCATION`
- Privacy ⇾ Contacts: `prefs:root=Privacy&path=CONTACTS`
- Privacy ⇾ Calendars: `prefs:root=Privacy&path=CALENDARS`
- Privacy ⇾ Reminders: `prefs:root=Privacy&path=REMINDERS`
- Privacy ⇾ Photos: `prefs:root=Privacy&path=PHOTOS`
- Privacy ⇾ Microphone: `prefs:root=Privacy&path=MICROPHONE`
- Privacy ⇾ Speech Recognition: `prefs:root=Privacy&path=SPEECH_RECOGNITION`
- Privacy ⇾ Camera: `prefs:root=Privacy&path=CAMERA`
- Privacy ⇾ Motion: `prefs:root=Privacy&path=MOTION\`

**App Store**

- App Store: `prefs:root=STORE`
- App Store ⇾ App Downloads: `prefs:root=STORE&path=App%20Downloads`
- App Store ⇾ Video Autoplay: `prefs:root=STORE&path=Video%20Autoplay`

**Wallet**

- Wallet: `prefs:root=PASSBOOK`

**Passwords & Accounts**

- Passwords & Accounts: `prefs:root=ACCOUNTS_AND_PASSWORDS`
- Passwords & Accounts ⇾ Fetch New Data: `prefs:root=ACCOUNTS_AND_PASSWORDS&path=FETCH_NEW_DATA`
- Passwords & Accounts ⇾ Add Account: `prefs:root=ACCOUNTS_AND_PASSWORDS&path=ADD_ACCOUNT`

**Mail**

- Mail: `prefs:root=MAIL`
- Mail ⇾ Preview: `prefs:root=MAIL&path=Preview`
- Mail ⇾ Swipe Options: `prefs:root=MAIL&path=Swipe%20Options`
- Mail ⇾ Notifications: `prefs:root=MAIL&path=NOTIFICATIONS`
- Mail ⇾ Blocked: `prefs:root=MAIL&path=Blocked`
- Mail ⇾ Muted Thread Action: `prefs:root=MAIL&path=Muted%20Thread%20Action`
- Mail ⇾ Blocked Sender Options: `prefs:root=MAIL&path=Blocked%20Sender%20Options`
- Mail ⇾ Mark Addresses: `prefs:root=MAIL&path=Mark%20Addresses`
- Mail ⇾ Increase Quote Level: `prefs:root=MAIL&path=Increase%20Quote%20Level`
- Mail ⇾ Include Attachments with Replies: `prefs:root=MAIL&path=Include%20Attachments%20with%20Replies`
- Mail ⇾ Signature: `prefs:root=MAIL&path=Signature`
- Mail ⇾ Default Account: `prefs:root=MAIL&path=Default%20Account`

**Contacts**

- Contacts: `prefs:root=CONTACTS`

**Calendar**

- Calendar: `prefs:root=CALENDAR`
- Calendar ⇾ Alternate Calendars: `prefs:root=CALENDAR&path=Alternate%20Calendars`
- Calendar ⇾ Sync: `prefs:root=CALENDAR&path=Sync`
- Calendar ⇾ Default Alert Times: `prefs:root=CALENDAR&path=Default%20Alert%20Times`
- Calendar ⇾ Default Calendar: `prefs:root=CALENDAR&path=Default%20Calendar`

**Notes**

- Notes: `prefs:root=NOTES`
- Notes ⇾ Default Account: `prefs:root=NOTES&path=Default%20Account`
- Notes ⇾ Password: `prefs:root=NOTES&path=Password`
- Notes ⇾ Sort Notes By: `prefs:root=NOTES&path=Sort%20Notes%20By`
- Notes ⇾ New Notes Start With: `prefs:root=NOTES&path=New%20Notes%20Start%20With`
- Notes ⇾ Sort Checked Items: `prefs:root=NOTES&path=Sort%20Checked%20Items`
- Notes ⇾ Lines & Grids: `prefs:root=NOTES&path=Lines%20%26%20Grids`
- Notes ⇾ Access Notes from Lock Screen: `prefs:root=NOTES&path=Access%20Notes%20from%20Lock%20Screen`

**Reminders**

- Reminders: `prefs:root=REMINDERS`
- Reminders ⇾ Default List: `prefs:root=REMINDERS&path=DEFAULT_LIST`

**Voice Memos**

- Voice Memos: `prefs:root=VOICE_MEMOS`

**Phone**

- Phone: `prefs:root=Phone`

**Messages**

- Messages: `prefs:root=MESSAGES`

**FaceTime**

- FaceTime: `prefs:root=FACETIME`

**Maps**

- Maps: `prefs:root=MAPS`
- Maps ⇾ Driving & Navigation: `prefs:root=MAPS&path=Driving%20%26%20Navigation`
- Maps ⇾ Transit: `prefs:root=MAPS&path=Transit`

**Compass**

- Compass: `prefs:root=COMPASS`

**Measure**

- Measure: `prefs:root=MEASURE`

**Safari**

- Safari: `prefs:root=SAFARI`
- Safari ⇾ Content Blockers: `prefs:root=SAFARI&path=Content%20Blockers`
- Safari ⇾ Downloads: `prefs:root=SAFARI&path=DOWNLOADS`
- Safari ⇾ Close Tabs: `prefs:root=SAFARI&path=Close%20Tabs`
- Safari ⇾ Clear History and Data: `prefs:root=SAFARI&path=CLEAR_HISTORY_AND_DATA`
- Safari ⇾ Page Zoom: `prefs:root=SAFARI&path=Page%20Zoom`
- Safari ⇾ Request Desktop Website: `prefs:root=SAFARI&path=Request%20Desktop%20Website`
- Safari ⇾ Reader: `prefs:root=SAFARI&path=Reader`
- Safari ⇾ Camera: `prefs:root=SAFARI&path=Camera`
- Safari ⇾ Microphone: `prefs:root=SAFARI&path=Microphone`
- Safari ⇾ Location: `prefs:root=SAFARI&path=Location`
- Safari ⇾ Advanced: `prefs:root=SAFARI&path=ADVANCED`

**News**

- News: `prefs:root=NEWS`

**Health**

- Health: `prefs:root=HEALTH`

**Shortcuts**

- Shortcuts: `prefs:root=SHORTCUTS`

**Music**

- Music: `prefs:root=MUSIC`
- Music ⇾ Cellular Data: `prefs:root=MUSIC&path=com.apple.Music:CellularData`
- Music ⇾ Optimize Storage: `prefs:root=MUSIC&path=com.apple.Music:OptimizeStorage`
- Music ⇾ EQ: `prefs:root=MUSIC&path=com.apple.Music:EQ`
- Music ⇾ Volume Limit: `prefs:root=MUSIC&path=com.apple.Music:VolumeLimit`

**TV**

- Settings ⇾ TV: `prefs:root=TVAPP`

**Photos**

- Photos: `prefs:root=Photos`

**Camera**

- Camera: `prefs:root=CAMERA`
- Camera ⇾ Record Video: `prefs:root=CAMERA&path=Record%20Video`
- Camera ⇾ Record Slo-mo: `prefs:root=CAMERA&path=Record%20Slo-mo`

**Books**

- Books: `prefs:root=IBOOKS`

**Game Center**

- Game Center: `prefs:root=GAMECENTER`


[1]:

[To see links please register here]

Reply

#18
As mentioned by [Karan Dua](

[To see links please register here]

) this is [now possible in iOS8][1] using `UIApplicationOpenSettingsURLString` see [Apple's Documentation][2].

**Example:**

**Swift 4.2**

UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!)


*In Swift 3:*

UIApplication.shared.open(URL(string:UIApplicationOpenSettingsURLString)!)

*In Swift 2:*

UIApplication.sharedApplication().openURL(NSURL(string:UIApplicationOpenSettingsURLString)!)



*In Objective-C*

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];

**Prior to iOS 8:**

You can not. As you said this has been covered many times and that pop up asking you to turn on location services is supplied by Apple and not by the App itself. That is why it is able to the open the settings application.

Here are a few related questions & articles:

[To see links please register here]


[To see links please register here]


[To see links please register here]


[To see links please register here]


[To see links please register here]


[To see links please register here]


[iOS: You’re Doing Settings Wrong][3]


[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

Reply

#19
As `openURL(_:)` is deprecated after iOS 10.0, use `open(_:options:completionHandler:)` instead.



if let settingsUrl = URL(string: UIApplication.openSettingsURLString) {
UIApplication.shared.open(settingsUrl, options: [:]) { completed in
if !completed {
print("Failed opening")
}
}
}
Reply

#20
From iOS 16, you can use [openSettingsURLString](

[To see links please register here]

)

```swift
if let url = URL(string: UIApplication. openSettingsURLString) {
await UIApplication.shared.open(url)
}
```
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

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