问题描述
我已尝试调用“addUIInterruptionMonitor”以获取应用跟踪透明度通知,但它没有注册并且在我的下一步中失败。任何有关此对话框描述的帮助都会有所帮助,“系统对话框”不起作用。
“允许……在其他公司的应用和网站上跟踪您的活动”“要求应用不要跟踪”“允许”
addUIInterruptionMonitor(withDescription: "System dialog") {
(alert) -> Bool in
if alert.buttons["Cancel"].exists {
alert.buttons["Cancel"].tap()
self.app.activate()
return true
}
return false
}
解决方法
找到解决方案,我使用的描述是“跟踪使用权限警报”
等待按钮出现的测试本身也是一个问题,该按钮仅在回答此对话框后才会出现
addUIInterruptionMonitor(withDescription: "Tracking Usage Permission Alert") {
(alert) -> Bool in
if alert.buttons["Allow"].exists {
alert.buttons["Allow"].tap()
self.app.activate()
return true
}
return false
}