-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Android 13 storage permission in @NeedsPermission #781
Comments
any update on this issue, how did you resolve it? |
How did you resolve the issue? |
I had to do something ugly to get this to work, you can't have the Api 33 and Api < 33 permission in the same annotation or else it won't work:
and then call the You have to also separate out the @OnShowRationale and @OnPermissionDenied and @OnNeverAskAgain. For example:
I don't think the library is well equipped to handle this in an elegant manner. |
That's what happens when requirements change and affected libraries aren't updated. No new update for over 2.5yrs means this project is effectively dead on the latest Android APIs imo. |
Agreed! I am also facing the same issue. We can get correct & contribute however by seeing pending PR over the years, I change my mind. Anyway planing to get rid of this lib at the earliest. |
Need to ask for READ_EXTERNAL_STORAGE) permission for API level lower than 33 and ask for READ_MEDIA_IMAGES permission for API level equal or higher than 33.
then we should use like below
private val readImagePermission = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) Manifest.permission.READ_MEDIA_IMAGES else Manifest.permission.READ_EXTERNAL_STORAGE
if(ContextCompat.checkSelfPermission(this, readImagePermission) == PackageManager.PERMISSION_GRANTED){
//permission granted
} else {
//permission not granted
}
But post using lib of permission dispatcher
we should use as
@NeedsPermission({Manifest.permission.READ_MEDIA_IMAGES,Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE})
but it is not working.
The text was updated successfully, but these errors were encountered: