You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But since Android 11, the ALLOW_FOREGROUND option was added.
It's OK with Permissions.clickOn(Permissions.Button.ALLOW_FOREGROUND)
but developers may consider allowViaDialog() as a silver bullet for granting runtime permissions.
So I hope this function to be able to handle both situations.
Maybe we could add a conditional to the handlePermissionRequest function?
like this
privatefunhandlePermissionRequest(button:Permissions.Button) {
val uiObjectButton = getPermissionDialogButtonAsUiObject(button).let {
if (it ==null&& button ==Permissions.Button.ALLOW) {
getPermissionDialogButtonAsUiObject(Permissions.Button.ALLOW_FOREGROUND)
} else {
it
}
}
if (uiObjectButton !=null&& uiObjectButton.exists()) {
uiObjectButton.click()
} else {
logger.e("In method handlePermissionRequest button=$button is not exist or is not found.")
}
}
It's a simple approach, and I'm sure there's another better way.
Thank you
The text was updated successfully, but these errors were encountered:
In
PermissionImpl
,allowViaDialog()
code is shown below.But since Android 11, the
ALLOW_FOREGROUND
option was added.It's OK with
Permissions.clickOn(Permissions.Button.ALLOW_FOREGROUND)
but developers may consider
allowViaDialog()
as a silver bullet for granting runtime permissions.So I hope this function to be able to handle both situations.
Maybe we could add a conditional to the
handlePermissionRequest
function?like this
It's a simple approach, and I'm sure there's another better way.
Thank you
The text was updated successfully, but these errors were encountered: