【发布时间】:2021-09-27 03:36:49
【问题描述】:
在我想将某些内容上传到 Firebase 存储之前,我的 Flutter android 应用运行良好。 我收到“没有请求的应用检查令牌”错误消息
有谁知道如何解决这个问题?
【问题讨论】:
-
如果AppCheck没有激活,访问存储受规则影响:
https://console.firebase.google.com/ > Storage > Rules。
在我想将某些内容上传到 Firebase 存储之前,我的 Flutter android 应用运行良好。 我收到“没有请求的应用检查令牌”错误消息
有谁知道如何解决这个问题?
【问题讨论】:
https://console.firebase.google.com/ > Storage > Rules。
【讨论】:
storageReference.ref(imageFilePath).imageRef.getDownloadURL();。
就我而言,我通过使用 await 类型转换解决了这个问题。您没有收到与应用检查令牌请求相关的错误。您因未等待下载完成而收到错误消息。只需在 UploadTask 完成所需的 await 之后添加行即可。
final Reference storageReference = firebase_storage.FirebaseStorage.instance
.ref()
.child("products")
.child("product_$productId.png");
String downloadURL;
UploadTask uploadTask = storageReference.putFile(mFileImage);
downloadURL = await (await uploadTask).ref.getDownloadURL();
【讨论】: