The "Prefs" Url Scheme Is Not Working in iOS 10 (Beta 1 & 2)

The prefs URL Scheme is not working in iOS 10 (Beta 1 & 2)

Just replace prefs to App-Prefs for iOS 10

Below code works for iOS 8,9,10

Swift 3.0 and Xcode >= 8.1

if #available(iOS 10.0, *)
{
UIApplication.shared.openURL(URL(string: "App-Prefs:root=SOMETHING")!)
}
else
{
UIApplication.shared.openURL(URL(string: "prefs:root=SOMETHING")!)
}

Swift 2.2

if #available(iOS 10.0, *)
{
UIApplication.sharedApplication().openURL(NSURL(string:"App-Prefs:root=SOMETHING")!)
}
else
{
UIApplication.sharedApplication().openURL(NSURL(string:"prefs:root=SOMETHING")!)
}

Works for me.

Happy Coding /p>

iOS 10 beta: URL scheme is not working but works in iOS 9

No way yet.

About 1 month before iOS 10 beta 1 was released, my app got a rejection because of opening a Preference.app URL. The app review team gave me a phone call to explain it: It's not permitted right now for the reason: Using private API. Only opening current app's setting page(UIApplicationOpenSettingsURLString) is allowed.

So it really makes sense now why they rejected me. Because no one could open system setting since iOS 10.

Updated answer at 8 Dec, 2016:

Using Private API (Don't submit the app with these code to the App Store):

@interface PrivateApi_LSApplicationWorkspace
- (BOOL)openSensitiveURL:(id)arg1 withOptions:(id)arg2;
@end

PrivateApi_LSApplicationWorkspace* _workspace;

_workspace = [NSClassFromString(@"LSApplicationWorkspace") new];

BOOL result = (BOOL)[_workspace openSensitiveURL:[NSURL URLWithString:@"Prefs:root=YOURSETTINGURLHERE"] withOptions:nil];

Using prefs URL Scheme in iOS 10 with LSApplicationWorkspace

Please refer to this link that I tried out and it worked. https://gist.github.com/johnny77221/bcaa5384a242b64bfd0b8a715f48e69f

iOS 10 Custom URL Scheme no longer working

I actually had to solve this by changing the way the servlet that sent the redirect worked. It only works if you click a link and are redirected from the html page now. Before iOS 10, I had it working so that you clicked a button which submitted a form and the redirect occurred from the servlet. Changing the logic and structure of that servlet, I now have a straight href link which invokes the callback URL, and that works. So nothing fixed in iOS - I'm still not sure what changed, presumably in Safari, to break this, but there you go.

iOS Launching Settings - Restrictions URL Scheme

AS @Nix Wang's ANSWER THIS IS NOT WORK IN IOS 10


WARNING: This method will not work for devices running iOS 5.1 and greater - See Hlung's comment below.

It's possible that the path component has a different name than the actual section, but it's also possible that you can't currently access that section straight from a URL. I found a list of possible URLs and Restrictions is not on it, maybe it's just not found out yet.

List of currently known URLs in the Settings app:

  • 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=Brightness
  • 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

can not jump to the system settings page

Apparently, it's not permitted anymore. You'll have to use UIApplicationOpenSettingsURLString for your own app settings.

You can read @Paulw11 answer here:
Answer



Related Topics



Leave a reply



Submit