permissions-dispatcher / PermissionsDispatcher

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

Feature request: @OnRequestPermission annotation #591

Closed WonderCsabo closed 3 years ago

WonderCsabo commented 5 years ago

Sometimes it is useful for apps to know when the permission dialog was actually shown. Currently it is not possible with annotations, because @NeedsPermission methods are also called when the permission was granted before, and the dialog is not shown - but this is expected. I am suggesting to create a new @OnRequestPermission (or such) annotation, which can be put on methods which are only called when we the permission dialog is actually presented to the user.

In our app the real use case is to send analytics when the permission dialog is shown.

hotchemi commented 5 years ago

Thank you for your suggestion! Can we consider a bit?

One of the our philosophy is that we're trying to provide less API as much as we can to reduce the burden of learning curve. (proudly) We've never added new API in a few years from 1.0 release. It might be better to support this scenario but on the other hand we're being really sensitive when adding new feature and strongly believe the value of "deciding not to do" 🙇

WonderCsabo commented 5 years ago

I see, thanks for your feedback. Please ping me if you have decided on this or need more input!

hotchemi commented 3 years ago

Sorry for the late, it's been a long since the issue was opened and now we don't have a concrete milestone to support this. Therefore let us close the issue.

Now we're focusing on ktx module and it does not use apt so that you may have more flexibility to deal with it JFYI 🙏