有没有办法以编程方式设置 CLLocationManager 的授权状态?
Is there any way to set authorization status of CLLocationManager programmatically?
我有两个自定义按钮,例如 "Allow" 和 "Don't Allow",用于访问应用程序的位置服务。当用户点击 "Don't Allow" 时,我想将授权状态设置为 kCLAuthorizationStatusRestricted 或 kCLAuthorizationStatusDenied。可能吗?
没有。
iOS 设置授权 - 你只能请求它。
如果您的想法奏效,应用程序不跟踪用户的整个想法将无效。
我有两个自定义按钮,例如 "Allow" 和 "Don't Allow",用于访问应用程序的位置服务。当用户点击 "Don't Allow" 时,我想将授权状态设置为 kCLAuthorizationStatusRestricted 或 kCLAuthorizationStatusDenied。可能吗?
没有。
iOS 设置授权 - 你只能请求它。
如果您的想法奏效,应用程序不跟踪用户的整个想法将无效。