Before I asked this question I had try:
- Use
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=Privacy&path=LOCATION"]];
It's work fine on iOS8 and iOS9,but there is nothing happen on iOS10. - Use
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
It's work fine on iOS8 and iOS9,too.However,on iOS10,when the app jump to system setting, the system setting exit immediately. - Use
[[UIApplication sharedApplication]openURL:url options:@{}completionHandler:nil];
It's crashed on iOS8 and iOS9,also,exit immediately on iOS10.
The question is can our app jump to system setting on iOS10? If yes.How?And for [[UIApplication sharedApplication]openURL:url options:@{}completionHandler:nil];
what's the options
means?We must code something for the options
?
Note:I use this method for a long time and everyting goes well,but today(2018-9-14),I had been rejected.
Here is my previous answer,do not use this method forever:
Now I use this way:
Note :- this solution will not be useful for ios10 onwards
Dont forget to add URL schemes :-
Go to Project settings --> Info --> URL Types --> Add New URL Schemes-->URL Schemes = prefs
after that Use this url :-
And open using :-
Enjoy :)..this worked for me.
Thanks to this guy. I figure out this URL Scheme
Prefs:root=Privacy&path=LOCATION
is only available in Today Widget, but no use in containing app.In Today Widget, you can try this:
More about system URL Schemes, you can see here.
This all I got. Hope it will help you.
For some time now, apps have only been permitted to open their own settings pane in the settings app. There have been various settings URLs that have worked in the past, but recently Apple has been rejecting apps that use these URLS.
You can open your own application's settings:
Or in Objective-C
If you are targeting version of iOS earlier than 10 then you may prefer to use the older, deprecated, but still functional method:
You can also open your app's setting center by opening
"App-Prefs:root=your app bundle id"
. This will be easy for user to change setting for your app.This works for me. iOS7 ~ iOS11
But if you are uing the iOS11, you can only jump to the app's setting page