-
-
Notifications
You must be signed in to change notification settings - Fork 87
RequestPermissionsAsync never returns when permission is requested #94
Comments
try my work around here: #93 (comment) |
Thanks @rizamarhaban. I have a different workaround, like described in the 2nd update. It works, but the possibility of crashes seems enough reason to let the author look into this in more detail and come with a solid solution. |
Closing as it was missconfigured |
@jamesmontemagno It was, but the fact still is that that method does not return its return type in all cases (like when permissions are requested). Saying "misconfigured" is the easy fix. Oh wait, it isn't a fix... |
If you create a small reproduction of the issue that would help. I have not had any issues like this at all in my apps, so actually seeing the issue is important to fix it. |
You're right. I'll post that tomorrow. |
Can you post that with a new clean issue as well :) |
Will do! |
@jamesmontemagno A day delay, but the new issue is #95 |
PermissionsPlugin/src/Plugin.Permissions/Permissions.android.cs
Line 191 in 22a4851
I get an exception on this line if a permission needs to be requested.
The specific exception is "Task got cancelled".
After either denying or allowing the permission prompt, further code after the call to this method is not executed and therefore I cannot check the result of the requested permission.
As workaround I now directly call ActivityCompat.RequestPermissions with a fixed string "android.permission.CAMERA" as that is the one I need at the moment.
However I would like to use this plugin if it works as intended.
UPDATE: This issue is very similar to what's described in #85
Another UPDATE: Turns out I had the OnRequestPermissionsResult in the wrong file.
I now manually re-check the permissions in this method after they are requested.
It would still be nice if the method would actually return its return type
Task<Dictionary<Permission, PermissionStatus>>
Therefore I leave this issue open.
The text was updated successfully, but these errors were encountered: