如何解决如何突出显示隐私请求弹出窗口?重新安装应用程序时出现一个弹出窗口,屏幕被白屏覆盖
我的应用使用来自iPhone的位置数据。为此,启动应用程序时会请求数据保护数据-它起作用。但是,如果我从iPhone删除该应用程序进行新测试并重新启动调试器,则iPhone / iPad上的显示仍会显示白屏,并且由于没有位置数据,调试器会产生错误。 iPhone不会询问要授予哪种许可。仅当我在iPhone上关闭应用程序(不在调试器中或在调试器中)时才显示查询。为什么-发生了什么事?有人知道解决方案吗?
如果我关闭该应用程序,并且黑屏消失,则弹出窗口变为可见。如果然后选择“ AuthorizedAlways”或“ AuthorizedWhenInUse”(在请求弹出窗口中),则该应用程序将按需运行...为什么将查询置于后台或为什么该查询被空白的白屏覆盖,以及如何我可以解决这个问题吗?回答位置查询后,一切正常。但是不显示!或被白屏覆盖。
此处是记录器的输出,直至调试器终止:0 --- AppDelegate:应用程序(_:didFinishLaunchingWithOptions:)>)
1 ---可观察到的:init(value:)>)
2 ---品牌:init()>)2020-10-18 09:23:02.559857 + 0200 Observer2 [2003:698275]启用了金属API验证
3 --- ViewController1:viewDidLoad()>)
4 --- ViewController1:setUpLocationManager()>)
5 --- ViewController1:checkLocationAuthorization()>)
AuthorizationStatus():0
致命错误:展开一个可选值时意外发现nil:文件Observer2 / ViewController1.swift,第143行2020-10-18 09:23:15.747456 + 0200 Observer2 [2003:698275]致命错误:展开时意外发现nil一个可选值:文件Observer2 / ViewController1.swift,第143行
//---------------------------------------------
override
func viewDidLoad() {
super.viewDidLoad()
setUpLocationManager()
checkLocationServices() /// <----
setUpMapView()
checkLocationAuthorization()
/// ....
}
/// ....
func checkLocationAuthorization() {
if locationManager?.location == nil {
locationManager = CLLocationManager()
locationManager!.requestAlwaysAuthorization()
locationManager!.requestWhenInUseAuthorization()
}
startAuthorizationStatus = CLLocationManager.authorizationStatus()
switch startAuthorizationStatus! {
case .authorizedWhenInUse: /// = 4
/// do Map Stuff
// startTrackingUserLocation()
break
case .denied:
/// show alert instructing them how to turn on permissions
break
case .notDetermined: /// = 0
locationManager!.requestWhenInUseAuthorization()
if startAuthorizationStatus == .notDetermined {
locationManager!.requestAlwaysAuthorization()
locationManager!.requestWhenInUseAuthorization()
startAuthorizationStatus = CLLocationManager.authorizationStatus()
}
break
case .restricted: /// = 1
/// show alert instructing them kNow what's up
break
case .authorizedAlways:
// startTrackingUserLocation() /// = 3
break
default:
print("unkNown Switch case")
break
} /// switch
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。