从 Firebase存储中提取图片时遇到问题。我收到错误消息:
com.google.firebase.storage.StorageException:用户无权访问此对象。
我已将firebase中的权限更改为以下所有内容,但这些权限均无效。
1
service firebase.storage {
match /b/wics-application.appspot.com/o {
match /public/{allPaths=**} {
allow read, write: if request.auth == null;
}
match /user/{allPaths=**} {
allow read, write: if request.auth == null;
}
match /auth/{allPaths=**} {
allow read, write: if request.auth == null;
}
}
}
2
service firebase.storage {
match /b/wics-application.appspot.com/o {
match /{allPaths=**} {
allow read, write;
}
}
}
我还有其他原因可以收到此消息吗?
答案 0 :(得分:0)
您是否创建了FirebaseUser的实例?
FirebaseAuth mAuth;
FirebaseUser mUser;
上面的onCreate和onCreate
mAuth = FirebaseAuth.getInstance();
mUser = mAuth.getCurrentUser();
然后致电您的存储空间