Search code examples
iosreact-nativepermissionsexpo

How to remove permissions for ios using expo


I have an app using expo, but I want to remove NSMicrophoneUsageDescription from de infoplist.

Using this command expo config --type introspect I got

 ios: {
   ....
    config: {
     ....
    },
    infoPlist: {
      ....
      NSCameraUsageDescription: 'Allow $(PRODUCT_NAME) to access your camera',
      NSPhotoLibraryUsageDescription: 'Allow $(PRODUCT_NAME) to access your photos',
      NSMicrophoneUsageDescription: 'Allow $(PRODUCT_NAME) to access your microphone',
     ...
}

my package.json dependencies

"dependencies": {
    "@expo/config": "^6.0.16",
    "@react-native-community/netinfo": "6.0.2",
    "@react-native-community/picker": "^1.8.1",
    "@react-navigation/elements": "^1.3.3",
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/native-stack": "^6.2.5",
    "@react-navigation/stack": "^6.0.11",
    "@reduxjs/toolkit": "^1.6.2",
    "@sentry/react-native": "^3.4.3",
    "@stripe/stripe-react-native": "0.2.2",
    "axios": "^0.24.0",
    "date-fns": "^2.28.0",
    "dotenv": "^16.0.0",
    "expo": "~43.0.2",
    "expo-app-loading": "~1.2.1",
    "expo-apple-authentication": "~4.0.3",
    "expo-application": "~4.0.0",
    "expo-auth-session": "~3.4.2",
    "expo-clipboard": "~2.0.3",
    "expo-constants": "~12.1.3",
    "expo-crypto": "~10.0.3",
    "expo-dev-client": "~0.6.3",
    "expo-device": "~4.0.3",
    "expo-document-picker": "~10.0.3",
    "expo-font": "~10.0.3",
    "expo-image-picker": "~11.0.3",
    "expo-linear-gradient": "^10.0.3",
    "expo-linking": "~2.4.2",
    "expo-localization": "~11.0.0",
    "expo-notifications": "~0.13.3",
    "expo-random": "~12.0.1",
    "expo-secure-store": "~11.0.3",
    "expo-status-bar": "~1.1.0",
    "expo-updates": "~0.10.15",
    "expo-web-browser": "~10.0.3",
    "firebase": "^9.5.0",
    "formik": "^2.2.9",
    "husky": "^7.0.4",
    "js-base64": "^3.7.2",
    "jwt-decode": "^3.1.2",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-native": "0.64.3",
    "react-native-app-intro-slider": "^4.0.4",
    "react-native-countdown-circle-timer": "^3.0.9",
    "react-native-country-picker-modal": "^2.0.0",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-get-random-values": "~1.7.0",
    "react-native-global-props": "^1.1.5",
    "react-native-paper": "^4.12.2",
    "react-native-paper-dates": "^0.8.7",
    "react-native-phone-number-input": "^2.1.0",
    "react-native-picker-select": "^8.0.4",
    "react-native-safe-area-context": "3.3.2",
    "react-native-screens": "~3.8.0",
    "react-native-step-indicator": "^1.0.3",
    "react-native-svg": "^12.1.1",
    "react-native-toast-message": "^2.1.1",
    "react-native-vector-icons": "^9.0.0",
    "react-native-web": "0.17.1",
    "react-native-webview": "11.13.0",
    "react-redux": "^7.2.6",
    "redux-logger": "^3.0.6",
    "redux-saga": "^1.1.3",
    "sentry-expo": "^4.2.0",
    "ts-interface-builder": "^0.3.2",
    "ts-interface-checker": "^1.0.2",
    "uuid": "^8.3.2",
    "yup": "^0.32.11"
  },

So, I want to remove unused permissions as NSMicrophoneUsageDescription but I don't know how, can you help me?

I read the documentation in expo for permissions but it says that the plugins has its own configurations for permissions but it does not say somenthing about remove them https://docs.expo.dev/guides/permissions/


Solution

  • This was resolved updating SDK to 45 and expo-image-picker to it more recent version, here you can modify in the app.json like this

     [
        "expo-image-picker",
        {
          "microphonePermission": false
        }
      ]