permissions-dispatcher / PermissionsDispatcher

A declarative API to handle Android runtime permissions.
https://github.com/permissions-dispatcher/PermissionsDispatcher
Apache License 2.0
11.21k stars 1.44k forks source link

onRequestPermissionsResult is deprecated #699

Open Dl7028 opened 3 years ago

Dl7028 commented 3 years ago

FAQs


Overview

Expected

Actual

Environment

Reproducible steps

hotchemi commented 3 years ago

thx, this is something we've been thinking of.

SaidAlSouti commented 3 years ago

Facing the same issue. It even caused infinite recursive.

hotchemi commented 3 years ago

It even caused infinite recursive.

what do you mean? I suppose it's not related to the issue 🤔

JeromeCHA commented 3 years ago

Hi, do you know when the deprecated methods will be support?

alvindizon commented 3 years ago

Facing warnings for this as well. We use Dagger version 2.33, which depends on newer Activity/Fragment APIs that deprecates onRequestPermissionsResult. Since onRequestPermissionsResult is used by permissiondispatcher generated code we are receiving warnings for this.

hotchemi commented 3 years ago

um...I know it's deprecated but I'm afraid we can't keep the current API with ActivityResultContract 🤔 Can anyone think of it?

In my understanding, the reason Google has deprecated onRequestPermissionsResult is just to induce us to use ActivityResultContract and I haven't been able to find an imminent reason to move on to ActivityResultContract to be honest. Maybe just suppressing the warning could be a temporal solution?

JeromeCHA commented 3 years ago

So we need to suppress warning in the generated PermissionDispatcher files?

tyborg commented 3 years ago

For a quick fix that can be enough, but better if you use the expected solution from Yuki-r's comment: https://github.com/permissions-dispatcher/PermissionsDispatcher/issues/699#issue-750935141

RustamSitdikov commented 3 years ago

So we need to suppress warning in the generated PermissionDispatcher files?

Will you do it?

JeromeCHA commented 3 years ago

@RustamSitdikov No, I don't really like to update generated code files. Instead, we have decided to remove PermissionDispatcher library and use ActivityResultContract with RequestMultiplePermissions.

blueiceheaven commented 3 years ago

@hotchemi Hi, I face the same problem of gradle report onRequestPermissionsResult is deprecated, do you have timeline or quick solution to fix that? We do not want to change the generated code files.