尝试使用FireBase云存储获取视频downloadUrl时
final storage = FirebaseStorage.instance;
downloadUrl() async {
final downloadUrl =
await storage.ref("User_uploadVideo/videoplayback.mp4").getDownloadURL();
return downloadUrl;
}抛出一个异常,表示Exception: [firebase_storage/unauthenticated] User is unauthenticated. Authenticate and try again.
即便如此,我也向公众开放了安全规则,以促进发展。
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}发布于 2022-05-16 23:39:59
试试这个:
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if true;
}
}
}main.dart
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
...另外,确保禁用了AppCheck。
https://stackoverflow.com/questions/72263314
复制相似问题