Firebase Storage Error: произошла неизвестная ошибка - PullRequest
0 голосов
/ 19 мая 2018

Я использую react-native-image-picker для инструмента выбора изображения, чтобы получить путь к файлу для функции putFile().Но выдается ошибка Error: An unknown error has occurred. после того, как я выбрал изображение при загрузке.

ImagePicker.showImagePicker(options, (response) => {
  console.log(JSON.stringify(response));

  if (response.didCancel) {
    console.log('User cancelled image picker');
  }
  else if (response.error) {
    console.log('ImagePicker Error: ', response.error);
  }
  else if (response.customButton) {
    console.log('User tapped custom button: ', response.customButton);
  }
  else {
    firebase.storage().ref("123.jpg").putFile(response.path).then((success) =>{
      console.log(success);
    })
    .catch((error)=>{
      console.log(error);
    })
  }
});

Ответ json от сборщика:

{
  "height": 464,
  "width": 825,
  "type": "image/jpeg",
  "fileName": "deadpool-2-domino-cable.jpg",
  "fileSize": 114189,
  "path": "/storage/emulated/0/Download/deadpool-2-domino-cable.jpg",
  "data": "thisisbase64string",
  "uri": "content://media/external/images/media/301465",
  "isVertical": true,
  "originalRotation": 0
}

react-native : 0.55.1 react-native-firebase : ^4.0.7

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...