如何突出显示隐私请求弹出窗口?重新安装应用程序时出现一个弹出窗口,屏幕被白屏覆盖

问题描述

我的应用使用来自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 (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...