expo生成的APK未保存给定权限

时间:2019-11-29 09:21:51

标签: android react-native expo

我有一个Expo应用程序,在iOS和Android上都可以正常运行,但是昨天我再次构建并使用内部测试轨道在Android中安装了该应用程序,现在该应用程序要求提供所需的权限,但我给了他们,应用程序的行为就像未获得许可一样。

我尝试重置应用管理器中的所有权限,还重新构建并再次发布,而expo仍然没有。

这是我用来请求权限的代码:

askPermission = async (requestedPermission) => {
        // Ask user for permission...
        const { status } = await Permissions.askAsync(requestedPermission);
        return status;
    }

    async uploadProfilePicture(){
        try{

            const status  = await this.askPermission(Permissions.CAMERA_ROLL);           
            if (status !== 'granted') {                
                    Alert.alert(i18n.t('permissions.camera_roll'));
            }else{
                let result = await ImagePicker.launchImageLibraryAsync();
            ...

这是我的app.json:

{
  "expo": {
    "name": "eazi",
    "slug": "eazi",
    "privacy": "public",
    "sdkVersion": "35.0.0",
    "platforms": [
      "ios",
      "android"
    ],
    "version": "1.0.0",
    "scheme": "eazi",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "primaryColor": "#FFFFFF",
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "buildNumber": "5",
      "supportsTablet": true,
      "bundleIdentifier": "com.eaziapp.ios",
      "infoPlist": {
        "NSCameraUsageDescription": "This app uses the camera to allow taking pictures to attach to requests."
      }
    },
    "android": {
      "versionCode": 7,
      "package": "com.eaziapp.android",
      "permissions": [
        "ACCESS_COARSE_LOCATION",
        "ACCESS_FINE_LOCATION",
        "CAMERA",
        "MANAGE_DOCUMENTS",
        "READ_EXTERNAL_STORAGE",
        "READ_PHONE_STATE"
      ]
    },
    "description": "",
    "hooks": {
      "postPublish": [
        {
          "file": "sentry-expo/upload-sourcemaps",
          "config": {
            "organization": "obscurred",
            "project": "obscurred",
            "authToken": "obscurred"
          }
        }
      ]
    }


  }
}

0 个答案:

没有答案