Menu

Remove ACCESS_FINE_LOCATION from an Expo app that uses expo-location
📰

Remove ACCESS_FINE_LOCATION from an Expo app that uses expo-location

DEV Community: reactnative·Mohamed Gado·3 days ago
#Vr25TKHc
#devtoreactnative#devto#dev#android#fine
Long article (671 words) — no AI summary yet.
Reading 0:00
15s threshold

Nafis , my gold-price app, uses the phone's location for one thing: picking the user's country so it shows local prices. A country doesn't need GPS. So I wanted the Android build to ask for approximate location only, ACCESS_COARSE_LOCATION , and drop ACCESS_FINE_LOCATION .

The obvious edit was to delete FINE from android.permissions in app.json :

"permissions" : [ "android.permission.ACCESS_COARSE_LOCATION" ]

Enter fullscreen mode

Exit fullscreen mode

I rebuilt, and FINE was still in the manifest.

Where FINE comes from

expo-location adds it in two places, and neither one reads your permissions list.

1. The config plugin. At the end of expo-location/plugin/build/withLocation.js (expo-location 58.0.22), the plugin always adds both:

return AndroidConfig . Permissions . withPermissions ( config , [ // Note: these are already added in the library AndroidManifest.xml and so // are not required here, we may want to remove them in the future.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.