Closed d3bt3ch closed 6 years ago
Relying on code generation and the annotation processor is arguably the cornerstone of PermissionsDispatcher's entire existence, so you won't gain much over the vanilla Android approach for Runtime Permissions if you don't use annotations.
If you still absolutely have to know the state of a given permission imperatively, our generated code uses boolean PermissionUtils.hasSelfPermissions(Context, String…)
to check if permissions are granted.
I would completely agree with you and as you said sometimes you have to know the state of a given permission imperatively and was just wondering if there is any way to do that PermissionsDispatcher so as to avoid writing a helper class.
Got it. You can use our PermissionUtils
in that case, as mentioned above. We do reserve the right to introduce backwards-incompatible changes to its API in later versions, but the signatures should remain pretty stable at this point, I suppose.
How can I explicitly check permissions without using annotations using PermissionsDispatcher ?