nativescript-community / perms

An unified permissions API for NativeScript on iOS and Android.
https://nativescript-community.github.io/perms/
Apache License 2.0
12 stars 9 forks source link

feat(android): add granular permissions for accessing photo, video, and audio #14

Closed williamjuan027 closed 1 year ago

williamjuan027 commented 1 year ago

New granular permissions when accessing media were introduced in Android 13 (Android docs). This PR adds the new granular permissions for >= API 33 and falls back to using android.permission.READ_EXTERNAL_STORAGE for < API 33.

@farfromrefug I noticed that the photo permission was using WRITE_EXTERNAL_STORAGE instead of READ_EXTERNAL_STORAGE, should the fallback for < API 33 use the WRITE_EXTERNAL_STORAGE or READ_EXTERNAL_STORAGE permission?

This is what the new permission dialog for accessing audio using the granular permissions looks like 👇

Screen Shot 2023-02-02 at 13 24 08

Compared to the previous dialog for accessing storage 👇

Screen Shot 2023-02-02 at 13 26 24
farfromrefug commented 1 year ago

@williamjuan027 very nice!