简体   繁体   中英

How to open Location screen, specifically Location permission screen where you select between Always, When in Use, Never?

The following piece of code opens the apps settings screen:

NSURL *appSettingsUrl = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
[[UIApplication sharedApplication] openURL:appSettingsUrl];

Is it possible to open the location authorization (permissions) screen. The screen where there's a list of three items Always, When in Use, Never?

在此处输入图片说明

There is no official way to open it. However other developers have discovered that the following URL may work: URL(string: "App-prefs:root=LOCATION_SERVICES") . As this is not documented it may not pass store review if that is your purpose.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM