How to decrease permission on Android.

Hi,
Before I knew it, some following permissions were granted in AndroidManifest.xml. Even though I only added CAMERA to android.permissions in app.json.

WRITE_EXTERNAL_STORAGE
ACCESS_BACKGROUND_LOCATION

Do you know what they are used for by Expo?
Also, is there a way to decrease them by using app.json etc. without ejecting?

thanks.

see: https://docs.expo.io/versions/latest/sdk/permissions/#permissions-on-android

on sdk 39 you have more control than on sdk 38

from release notes:

Android permissions

We also did a full audit of how we handle native Android permissions as part of our bug bash. With the help of your feedback, we updated our permissions documentation to better communicate each module’s required and optional permissions. We also added more context around the behavior of permissions on different platforms. If you still have questions, or are unsure about the permissions in your standalone app, don’t hesitate to ask in our forums!

https://blog.expo.io/expo-sdk-39-is-now-available-4c10aa825e3f

@notbrent
thanks for your response.

I see.
I assume that these permissions are default.
I feel like these permissions shouldn’t be decreased, so it’s better not to do anything about it.

https://docs.expo.io/versions/latest/sdk/permissions/#permissions-on-android :

Expo will also include the minimum permissions it requires to run.

thanks

in sdk 38 the minimum permissions are different from sdk 39, and permissions like ACCESS_BACKGROUND_LOCATION were removed from the default list i believe. cc @bycedric

1 Like

thanks,
I try upgrade to 39 and build it.

thanks for your helping!

@notbrent Yes, that’s correct. Every Expo module can add additional permissions to your app, because it needs access to certain APIs. If you want to customize that, you have to define the android.permissions list in your app.json.

With the latest SDK we added permissions to our “blocklist”, if you define this permissions list in your manifest. Both ACCESS_BACKGROUND_LOCATION and WRITE_EXTERNAL_STORAGE are removed when you don’t include them in the permissions list.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.