addUIInterruptionMonitor在运行iOS 14.0.1的设备上不起作用

问题描述

自从将设备(iPhone 11)升级到iOS 14.0.1之后,我发现addUIInterruptionMonitor()根本不会被触发。在iOS 13.4.1(我安装的最新版本)之前,它就可以运行。

我的代码

addUIInterruptionMonitor(withDescription: "App Would Like to Send You Notifications") { (alert) -> Bool in
    if alert.buttons["Allow"].exists {
        alert.buttons["Allow"].tap()
        return true
    }
    return false
}

XCUIApplication().tap()  // interacting with the app to trigger the interruption monitor

升级以来,我的代码没有任何改变-唯一改变的是安装的iOS版本。其他人遇到过类似的事情吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)