iphone 再次请求当前位置权限

标签 iphone ios ios6 cllocationmanager

案例:对于当前位置,用户在应用安装时选择了“不允许”,那么有什么方法可以让我再次询问用户位置并触发当前位置的 native iphone 警报?

我在 stackoverflow 上看到了一些帖子,但是有一些旧帖子,现在有没有调用新 sdk 的解决方案或者有人找到了方法,

帖子引用: CLLocation ask again for permission

最佳答案

很遗憾,您不能这样做。您可以做的一件事是提示用户更改位置设置。

if (![CLLocationManager locationServicesEnabled]) 
{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Location Service Disabled" 
                                                        message:@"To re-enable, please go to Settings and turn on Location Service for this app." 
                                                       delegate:nil 
                                              cancelButtonTitle:@"OK" 
                                              otherButtonTitles:nil];
        [alert show];
}

关于iphone 再次请求当前位置权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17229065/

相关文章:

iphone - 如何从 Objective-C 中的 View Controller 访问主窗口?

iphone - 如何为 iOS 复制 Facebook 的撰写状态屏幕?

iphone - 如何引用 iPhone 中保存为 "object for key"的日期对可变数组进行排序?

iphone - UIwebView链接延迟

ios - 安全的 iBeacon 蓝牙连接

iphone - UICollectionViewCell 抖动

iphone - 用动画替换 window.rootViewController 部分有效

ios - 无法使用类型为 '^' 的参数列表调用 '($T27, IntegerLiteralConvertible)'

向下滚动时 iPhone Storyboard 自定义单元格消失

ios - 如何最好地处理核心数据 + iOS 状态恢复?