Saturday, May 21, 2022
HomeiOS Developmentios - Error importing video to cloud storage swiftui

ios – Error importing video to cloud storage swiftui


I have a video creating process where a user selects a video using UIImagePickerController. After selecting a video, the url of the video is passed to the video details page. Once the user completes the details and clicks upload, I run this code:

if canProceed(){
    
    let fileName = "(UUID().uuidString).mov"
    
    storage.reference(withPath: "videos/(Auth.auth().currentUser?.email ?? "")/(fileName)").putFile(from: vidURL, metadata: nil) { metadata, err in
        
        if err != nil{
            print(err)
            return
        }
        
        metadata?.storageReference?.downloadURL(completion: { url, err in               
            if err != nil{
                print(err)
                return
            }
            
            db.collection("reelPool").document(fileName).setData(["url": url])
        })            
    }        
}

Nothing is uploaded to cloud storage and the return is:

Error Domain=FIRStorageErrorDomain Code=-13000 “An unknown error occurred, please check the server response.”

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments