skip to Main Content

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?

2

Answers


  1. 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"
        }
    
    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search