如何解决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 举报,一经查实,本站将立刻删除。