0

I've read the new Expo docs regarding asking permissions ... And It's not clear if you're facing a lib that doesn't provide an helper for permissions !

The only thing I've noticed is in this sentence :

Most permissions are added automatically by libraries that you use in your app either with config plugins or with a package-level AndroidManifest.xml, so you won't often need to use android.permissions to add additional permissions.

Does this mean that we could still use the PermissionAndroid for some custom plugins that doesn't provide a specific requestPermissionFunction() as exo-location does ( Location.requestForegroundPermissionsAsync(); ) ? Despite the warning in the front page of react native website ? ....

enter image description here

I'm trying to use the react-native-wifi-p2p lib and it need those permissions :

"android.permission.ACCESS_COARSE_LOCATION",
"android.permission.ACCESS_WIFI_STATE",
"android.permission.CHANGE_WIFI_STATE",
"android.permission.WRITE_EXTERNAL_STORAGE",
"android.permission.READ_EXTERNAL_STORAGE",

Is it even possible to use this lib with expo ? Any help would be appreciated !

Rob
  • 14,746
  • 28
  • 47
  • 65
Seba99
  • 1,197
  • 14
  • 38
  • try adding "permissions" section in app.json https://docs.expo.dev/versions/latest/config/app/#permissions – Dmitro_ Oct 24 '22 at 06:24
  • **DO NOT post images of code, data, error messages, etc.** - copy or type the text into the question. [ask] – Rob Oct 24 '22 at 10:14

1 Answers1

0

@Wodin from the expo team helped me on this one

The answer is : YES, we can use the PermissionAndroid from react native.

And add all the permissions in the app.json file at expo.android.permissions = [...] also.

Link to the original answer

Seba99
  • 1,197
  • 14
  • 38