private func acceptPermissionAlert() {
_ = addUIInterruptionMonitor(withDescription: "") { alert -> Bool in
if alert.buttons["Don’t Allow"].exists { //doesnt get here second time
alert.buttons.element(boundBy: 1).tapWhenExists()
return true
}
return false
}
}
and this doesnt work for:
In the beginning of the app, it works perfect while acepting permission for notifications, but here... doesnt work.
Do you know why?
Add:
app.activate()
at the end of the method.
It will bring the app to foreground again (it will be in background because of the system alert)