【发布时间】:2020-01-26 00:15:25
【问题描述】:
在 iOS 12 上完美运行。
简单的样板代码:
let storageRef = storage.reference().child("\(profile.studioCode)/\(selected.classId)/\(uploadDate)")
//Upload file and metadata
let uploadTask = storageRef.putFile(from: videoURL, metadata: metadata)
//Listen for state changes and, errors, and completion of the upload
uploadTask.observe(.resume) { (snapshot) in
//upload resumed or started
}
uploadTask.observe(.pause) { (snapshot) in
//upload paused
}
uploadTask.observe(.progress) { (snapshot) in
//upload progress
}
uploadTask.observe(.success) { (snapshot) in
//upload successful
}
uploadTask.observe(.failure) { (snapshot) in
//upload failed
}
给我:
Error Domain=FIRStorageErrorDomain Code=-13000 "An unknown error occurred, please check the server response."
我已将 Cocoapods 和 Firebase 更新到最新版本,尝试允许任意加载,并尝试退出并重新登录应用程序以重置我的身份验证令牌。在 iOS 13 中,它会在上传时立即引发该错误,但在 iOS 12 中,它上传得非常好。任何帮助或见解将不胜感激。谢谢!
【问题讨论】:
-
您检查以确保此
"\(profile.studioCode)/\(selected.classId)/\(uploadDate)有效吗?即没有零和有效数据?也许添加一个print("\(profile.studioCode)/\(selected.classId)/\(uploadDate)"
标签: ios swift firebase firebase-storage ios13