0
真正需要幫助的人,這是我的火力地堡儲存安全規則火力地堡getDownloadURL不工作的Android
service firebase.storage {
match /b/shoppinglist-XXXX.appspot.com/o {
match /{allPaths=**} {
allow read, write;
}
}
}
這是我的Java代碼來獲得一個URL鏈接
storageRef = FirebaseStorage.getInstance().getReference();
pathRef = storageRef.child("MyBook.pdf");
storageRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
Log.d(tag, "MyDownloadLink: " + uri);
}
});
這是我的錯誤:
StorageException has occurred.
User does not have permission to access this object.
{ "error": { "code": 403, "message": "Developer credentials required." }}
java.io.IOException: { "error": { "code": 403, "message": "Developer credentials required." }}
有人請幫助!
它的工作!謝謝,我在使用storageRef的時候應該一直使用pathRef,謝謝Qbix。 – JtecX