Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onRequestPermissionsResult is deprecated #699

Open
Dl7028 opened this issue Nov 25, 2020 · 11 comments
Open

onRequestPermissionsResult is deprecated #699

Dl7028 opened this issue Nov 25, 2020 · 11 comments

Comments

@Dl7028
Copy link

Dl7028 commented Nov 25, 2020

FAQs


Overview

  • onRequestPermissionsResult is deprecated

Expected

  • use registerForActivityResult(ActivityResultContract, ActivityResultCallback) passing in a RequestMultiplePermissions object for the ActivityResultContract and handling the result in the callback.

Actual

  • What is the actual behavior?

Environment

  • Which library version are you using?
  • On which devices do you observe the issue?
  • Note any other information that might be useful

Reproducible steps

  • While it's not required, it'd be perfect to add a link to a sample project where you encounter the issue
@hotchemi
Copy link
Member

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

@SaidAlSouti
Copy link

SaidAlSouti commented Nov 28, 2020

Facing the same issue.
It even caused infinite recursive.

@hotchemi
Copy link
Member

It even caused infinite recursive.

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

@JeromeCHA
Copy link

JeromeCHA commented Mar 12, 2021

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

@alvindizon
Copy link

alvindizon commented Mar 18, 2021

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
Copy link
Member

hotchemi commented Mar 25, 2021

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
Copy link

JeromeCHA commented May 12, 2021

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

@tyborg
Copy link

tyborg commented May 12, 2021

For a quick fix that can be enough, but better if you use the expected solution from Yuki-r's comment: #699 (comment)

@RustamSitdikov
Copy link

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

Will you do it?

@JeromeCHA
Copy link

@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
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants