Firebase: Provided bucket does not match the Storage bucket of the current instance in Swift

前端 未结 3 590
日久生厌
日久生厌 2021-01-13 17:36

I have the following code:

let storageRef = FIRStorage().reference(forURL: \"gs://slugbug-....appspot.com\") // dots intentional
let imageRef = storageRef.ch         


        
3条回答
  •  佛祖请我去吃肉
    2021-01-13 17:59

    Use below code work

     // call storage ref from link
     self.storageRef =  FIRStorage.storage().reference(forURL: "your_URL")
    
         // Assuming your image size < 10MB.
         self.storageRef.data(withMaxSize: 10*1024*1024, completion: { (data, error) in
               if data != nil{ // if image found 
                  let photo = UIImage(data: data!)
                      // User photo here
                   }
         })
    

提交回复
热议问题