README.mkd

August 23, 2021 · View on GitHub

List for iOS URLS SCHEMES

WARNING DEPRECATION

From iOS 11 the schemes url's stoped working correctly. Be aware that from iOS 11 to now iOS 14 this won't work.

Past times are always better

The gist I started on 2015 has now 201 stars (02/25/2017) and a lot of comments. But since gist does not provides a notification feature when someone comments and I can't answer right away, I hope with the issue area in github we can share more doubts and improvements. Thank You all!

Note

Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

Updates

  • [UPDATE 5] Apparently we're having problems with iOS 11 and schemes. it seems Apple changed one more time how we reach url schemes...some of them aren't working in mobile phones (but were working in simulator till' Xcode 9 GM)

  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs

  • [UPDATE 3: For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached]

  • [UPDATE 2:The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead]

  • [UPDATE : Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.]

Testing

Download this Workflow to find and test new App-prefs: URL Schemes by @deanlyoung

Other Apps' Settings

Sometimes we need to open Setting's Preferences not of our app, but of the iPhone itself. What should we do to acomplish this?

keyboard

  1. You must configure the URL Schemes in your project. You will find it in Target, Info, URL Scheme. Once there, just type prefs

settings

2.- Later, just write the code with the URL path of the preference needed. In my case was the keyboard path.

Swift 1.2

   UIApplication.sharedApplication().openURL(NSURL(string:"prefs:root=General&path=Keyboard")!)

Swift 3.0

This is a work around to open your app's preferences, but it will crash if you don't have any.

Open apps's preferences:

Note: you don't need to add prefs text inside URL Types

    if #available(iOS 10.0, *) {
        UIApplication.shared.open(URL(string:UIApplicationOpenSettingsURLString)!)
    }

Open OS preferences:

   UIApplication.shared.open(URL(string:"App-prefs:root=General&path=Keyboard")!)

Swift 4.0

Open apps's preferences:

Note: you don't need to add prefs text inside URL Types

   if #available(iOS 10.0, *) {
     let settingsUrl = NSURL(string:UIApplicationOpenSettingsURLString)! as URL
     UIApplication.shared.open(settingsUrl, options: [:], completionHandler: nil)
   }

Open OS preferences:

    if #available(iOS 10.0, *) {
        let url = NSURL(string:"App-prefs:root=General&path=Keyboard")! as URL
        UIApplication.shared.open(url)
    }

Objective-c

  [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=General&path=Keyboard"]];

Open App's settings extension

extension UIApplication {
   
    func openAppSettings() {
        if let url = URL(string:UIApplicationOpenSettingsURLString) {
            openExpectedURL(url)
        }
    }
    
    fileprivate func openExpectedURL(_ url: URL) {
        if UIApplication.shared.canOpenURL(url) {
            if #available(iOS 10.0, *) {
                UIApplication.shared.open(url, options: [:], completionHandler: nil)
            }else{
                UIApplication.shared.openURL(url)
            }
        }
    }
    
}

More info:

URL Schemes

DescriptionCommand Swift < 3 OR ObjcSwift 3
Settings Section topmost levelFrom Widget (Prefs:)From App (App-prefs:)
Aboutprefs:root=General&path=AboutApp-prefs:root=General&path=About
Accessibilityprefs:root=General&path=ACCESSIBILITYApp-prefs:root=General&path=ACCESSIBILITY
Account Settingsprefs:root=ACCOUNT_SETTINGSApp-prefs:root=ACCOUNT_SETTINGS
Airplane Modeprefs:root=AIRPLANE_MODEApp-prefs:root=AIRPLANE_MODE
Autolock iOS < 10prefs:root=General&path=AUTOLOCKApp-prefs:root=General&path=AUTOLOCK
Auto-Lock iOS > 10prefs:root=DISPLAY&path=AUTOLOCKApp-prefs:root=DISPLAY&path=AUTOLOCK
Apple Pay / Walletshoebox://url-schemeshoebox://url-scheme
Batteryprefs:root=BATTERY_USAGEApp-prefs:root=BATTERY_USAGE
Brightnessprefs:root=BrightnessApp-prefs:root=Brightness
Bluetooth iOS < 9prefs:root=General&path=BluetoothApp-prefs:root=General&path=Bluetooth
Bluetooth iOS > 9prefs:root=BluetoothApp-prefs:root=Bluetooth
Castleprefs:root=CASTLEApp-prefs:root=CASTLE
Cellular Usageprefs:root=General&path=USAGE/CELLULAR_USAGEApp-prefs:root=General&path=USAGE/CELLULAR_USAGE
Configuration Listprefs:root=General&path=ManagedConfigurationListApp-prefs:root=General&path=ManagedConfigurationList
Date and Timeprefs:root=General&path=DATE_AND_TIMEApp-prefs:root=General&path=DATE_AND_TIME
Do not disturbprefs:root=General&path=DO_NOT_DISTURBApp-prefs:root=General&path=DO_NOT_DISTURB
Facetimeprefs:root=FACETIMEApp-prefs:root=FACETIME
Generalprefs:root=GeneralApp-prefs:root=General
Internet Tetheringprefs:root=INTERNET_TETHERINGApp-prefs:root=INTERNET_TETHERING
iTunesprefs:root=MUSICApp-prefs:root=MUSIC
iTunes Equalizerprefs:root=MUSIC&path=EQApp-prefs:root=MUSIC&path=EQ
iTunes Volumeprefs:root=MUSIC&path=VolumeLimitApp-prefs:root=MUSIC&path=VolumeLimit
Keyboardprefs:root=General&path=KeyboardApp-prefs:root=General&path=Keyboard
Deeper in Keyboardprefs:root=General&path=Keyboard/KEYBOARDSApp-prefs:root=General&path=Keyboard/KEYBOARDS
Lang Internationalprefs:root=General&path=INTERNATIONALApp-prefs:root=General&path=INTERNATIONAL
Location Servicesprefs:root=Privacy&path=LOCATIONApp-Prefs:root=Privacy&path=LOCATION
Mobile Dataprefs:root=MOBILE_DATA_SETTINGS_ID
Networkprefs:root=General&path=NetworkApp-prefs:root=General&path=Network
Nike iPodprefs:root=NIKE_PLUS_IPODApp-prefs:root=NIKE_PLUS_IPOD
Notesprefs:root=NOTESApp-prefs:root=NOTES
Notifications IDprefs:root=NOTIFICATIONS_IDApp-prefs:root=NOTIFICATIONS_ID
Passcode / Touch IDprefs:root=TOUCHID_PASSCODEApp-prefs:root=TOUCHID_PASSCODE
Passbookprefs:root=PASSBOOKApp-prefs:root=PASSBOOK
Phoneprefs:root=PhoneApp-prefs:root=Phone
Photo Camera Rollprefs:root=PhotosApp-prefs:root=Photos
PrivacyPrefs:root=PrivacyApp-prefs:root=Privacy
Profiles & Device ManagementPrefs:root=General&path=ManagedConfigurationListApp-prefs:root=General&path=ManagedConfigurationList
Resetprefs:root=General&path=ResetApp-prefs:root=General&path=Reset
Ringtoneprefs:root=Sounds&path=RingtoneApp-prefs:root=Sounds&path=Ringtone
Siriprefs:root=SIRIApp-prefs:root=SIRI
Safariprefs:root=SafariApp-prefs:root=Safari
Siri iOS < 10?prefs:root=General&path=AssistantApp-prefs:root=General&path=Assistant
Siri iOS > 10?prefs:root=SIRIApp-prefs:root=SIRI
Soundsprefs:root=SoundsApp-prefs:root=Sounds
Software Updateprefs:root=General&path=SOFTWARE_UPDATE_LINKApp-prefs:root=General&path=SOFTWARE_UPDATE_LINK
Storage & Backupprefs:root=CASTLE&path=STORAGE_AND_BACKUPApp-prefs:root=CASTLE&path=STORAGE_AND_BACKUP
Storeprefs:root=STOREApp-pref:root=STORE
Twitterprefs:root=TWITTERApp-prefs:root=TWITTER
Usageprefs:root=General&path=USAGEApp-prefs:root=General&path=USAGE
Videoprefs:root=VIDEOApp-prefs:root=VIDEO
VPNprefs:root=General&path=Network/VPNApp-prefs:root=General&path=Network/VPN
Wallpaperprefs:root=WallpaperApp-prefs:root=Wallpaper
WIFIprefs:root=WIFIApp-prefs:root=WIFI

Open other App's Notification settings

You can open any app notification's settings, only if that app HAS notifications enabled. For that you need the bundleID added in path:

   UIApplication.shared.openURL(NSURL(string:"App-prefs:root=NOTIFICATIONS_ID&path=com.microsoft.Office.Word")! as URL)

Finding an app's bundle identifier of any app:

  • Find the app you are looking for on the Apple AppStore. For this example, we’ll use Yelp: https://itunes.apple.com/us/app/yelp/id284910350?mt=8
  • Copy the app ID number. It’s just the numbers after the text “id” and before the “?”. So in this case, it is: 284910350.
  • Paste that ID number into this URL: https://itunes.apple.com/lookup?id=284910350
  • This will download a file 1.txt
  • Search the output you get back for “bundleId”. The app’s bundle ID will be listed there: com.yelp.yelpiphone

source: https://kb.acronis.com/content/39368

Bluetooth

As @johnny77221 mention in comments, he impleted a way to open bluetooth settings, read in link above:

https://gist.github.com/johnny77221/bcaa5384a242b64bfd0b8a715f48e69f

Apple Pay / Wallet

by @luismadrigal

shoebox://

Cordova Plugin

@guyromb made a cordova plugin

https://github.com/guyromb/Cordova-open-native-settings/blob/master/src/ios/NativeSettings.m

A cocopods plugin

it seems @yoiang made a plugin for cocoapods. Although it appears that is not updated to iOS > 10 but you can contribute to his project if you like it ;)

https://github.com/Adorkable/SettingsAppAccessiOS

Open App Store

   UIApplication.shared.openURL(URL(string: "itms-apps://itunes.apple.com/app/id" + appStoreAppID)!)

Contributions:

@antonjn, @mikengyn, @johnny77221, @luismadrigal, @guyromb, @yoiang, @deanlyoung, @axlmagnum