Authorization Status(Application)"默认设置为 "Never"-6ren"> Authorization Status(Application)"默认设置为 "Never"-如果位置服务授权状态是KCLAuthorizationStatusNotDetermined,那么如何将其设置为KCLAuthorizationStatusNever? 最佳答案 如果状态为 kCLA-6ren">
gpt4 book ai didi

ios - 如何将 "Location Services -> Authorization Status(Application)"默认设置为 "Never"

转载 作者:行者123 更新时间:2023-11-29 02:21:28 25 4
gpt4 key购买 nike

如果位置服务授权状态KCLAuthorizationStatusNotDetermined,那么如何将其设置为KCLAuthorizationStatusNever

最佳答案

如果状态为 kCLAuthorizationStatusNotDetermined,那么您可以要求用户获得这样的许可。

if (status == kCLAuthorizationStatusNotDetermined) {
[self.locationManager requestAlwaysAuthorization];
}

这是状态码列表

1-kCLAuthorizationStatusNotDetermined //User hasn’t yet been asked to authorize location updates

2-kCLAuthorizationStatusRestricted //User has location services turned off in Settings (Parental Restrictions)

3-kCLAuthorizationStatusDenied //User has been asked for authorization and tapped “No” (or turned off location in Settings)

4-kCLAuthorizationStatusAuthorized //User has been asked for authorization and tapped “Yes” on iOS 7 and lower.

5-kCLAuthorizationStatusAuthorizedAlways = kCLAuthorizationStatusAuthorized

//User authorized background use.

6-kCLAuthorizationStatusAuthorizedWhenInUse

//User has authorized use only when the app is in the foreground.

关于ios - 如何将 "Location Services -> Authorization Status(Application)"默认设置为 "Never",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28081708/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com