Home > front end >  Where did i find AndroidManifest.xml file in React Native Expo file?
Where did i find AndroidManifest.xml file in React Native Expo file?

Time:07-28

Where did i find AndroidManifest.xml file in React Native Expo file for requesting permissions?

There is any other ways to request permission from user?

CodePudding user response:

Basically, EXPO is a tool and provides tools to create a React-native app, When you create an app using EXPO there is no android/ios folder/project inside the react-native expo project if you need to add permissions in Android/iOS just update/Change you app.json / app.config.js

update your app.config.js to look like

export default {
  expo: {

    android: {
  
      permissions: ["ACCESS_COARSE_LOCATION", "ACCESS_FINE_LOCATION"],
      config: {
        googleMaps: {
          apiKey: "...abc...",
        },
      },
    }
  },
};

You also check this official site for more info regarding this
https://docs.expo.dev/versions/latest/config/app/#permissions

CodePudding user response:

add permissions array inside your app.json like this

{
  "expo": {
    "name": "Page",

   ...

    "ios": {
      "supportsTablet": false
    },
    "android":{
      "permissions":["READ_EXTERNAL_STORAGE", "WRITE_EXTERNAL_STORAGE"],
      "package":"com.example.app"
    }
  }
}

So your app.json should be

    "android":{
      "permissions":["READ_EXTERNAL_STORAGE", "WRITE_EXTERNAL_STORAGE"],
      "package":"com.example.app"
    }
  • Related