Granular media permissions Android 13 API 33
Asked Answered
C

1

10

I've been upgrading my project to SDK 33.

I changed the permissions where I needed to access media files, such as photos, with the new permission READ_MEDIA_IMAGES and it is working fine.

But I need to access documents such as PDF files in order to upload them to the server, but I cannot find any information concerning android 13 and documents.

Before the upgrade I had READ_EXTERNAL_STORAGE permission and I accessed all the files.

In the andorid documentation on the link below, only these three permissions are provided READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, READ_MEDIA_AUDIO instead of using READ_EXTERNAL_STORAGE.

https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions

Any ideas on how to fix this and what steps to follow?

Chancechancel answered 19/8, 2022 at 8:58 Comment(1)
You can either choose PhotoPicker or go with the granular permission approach codewithninad.com/accessing-android-storage-on-android-13-aboveSystematism
G
9

According to Google storage documentation. It seems that for non-media files no permission is needed. https://developer.android.com/training/data-storage.

Grodin answered 29/8, 2022 at 22:27 Comment(2)
Thank you, this one saved me. Another thing I wonder, using the system file picker I can still upload media files from there, is it okay if I leave it like that so users can upload either images or pdfs, or I must divide the file picker from the image picker?Chancechancel
I was fighting against the permission for a PDF my app generated -.- Thanks!Calloway

© 2022 - 2024 — McMap. All rights reserved.