我收到此错误:
E/StorageUtil(21342): error getting token java.util.concurrent.ExecutionException: com.google.firebase.internal.api.FirebaseNoSignedInUserException: Please sign in before trying to get a token.
W/NetworkRequest(21342): no auth token for request
当我从https://stackoverflow.com/a/50877590/9272698执行此代码时(要从具有Firestore Storage的图像中获取下载URL):
Future _getImageUrl() async {
final ref = FirebaseStorage.instance.ref().child('lake');
var url = await ref.getDownloadURL();
return url;
}
这不是由于我的Firestore规则所致,因为我启用了它,使其像这样公开:
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
此外,我不认为这是由于互联网连接,因为我能够从Firebase Cloud Database加载字段。你有解决方案吗?非常感谢