Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Firebase上载未获取下载URL_Javascript_Firebase_Ionic Framework_Firebase Storage - Fatal编程技术网

Javascript Firebase上载未获取下载URL

Javascript Firebase上载未获取下载URL,javascript,firebase,ionic-framework,firebase-storage,Javascript,Firebase,Ionic Framework,Firebase Storage,我正在开发一个函数,在这个函数中,我将从emulator上传图像,并将其发送到firebase存储。我想获取下载URL并将其放入firebase firestore,但我没有检索下载URL。如蒙帮助,我将不胜感激。。非常感谢。 我目前正在使用firebase存储和firestore,ionic v5进行我的项目 uploadToStorage(){ let options: CameraOptions ={ quality : 100, destinationType:thi

我正在开发一个函数,在这个函数中,我将从emulator上传图像,并将其发送到firebase存储。我想获取下载URL并将其放入firebase firestore,但我没有检索下载URL。如蒙帮助,我将不胜感激。。非常感谢。 我目前正在使用firebase存储和firestore,ionic v5进行我的项目

uploadToStorage(){
  let options: CameraOptions ={
    quality : 100,
    destinationType:this.camera.DestinationType.DATA_URL,
    encodingType : this.camera.EncodingType.JPEG,
    sourceType : this.camera.PictureSourceType.PHOTOLIBRARY
  }
  this.camera.getPicture(options).then((data)=>{
    var storage = this.store.ref('/AAA');
    var photoRef = storage.child(this.mAuth.auth.currentUser.uid);
    let base64img = 'data:image/jpeg;base64' + data;
    var message = data;
    photoRef.putString(message , 'base64', { contentType: 'image/jpg' }).then((savedPicture) => {
      savedPicture.downloadURL().subscribe((datas)=>{
        console.log(datas)
      })
});
    
  });
}

请编辑问题,以准确解释此代码在您运行时实际执行的操作与您预期的不同。添加更多日志以跟踪其行为。
savedPicture.snapshot.ref.downloadURL().then((datas)=>{
   console.log(datas)
})