JtecX JtecX - 17 days ago 7
Android Question

Firebase getDownloadURL Not working Android

Really need help guys, Here is my Firebase Storage Security Rule

service firebase.storage {
match /b/shoppinglist-XXXX.appspot.com/o {
match /{allPaths=**} {
allow read, write;
}
}
}


Here is my Java Code to get a URL Link

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);
}
});


Here is my Error:

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." }}


Can Someone Please Help!

Answer

You probably meant to download from pathRef, not storageRef. Downloading from the root of the storage tree is not permitted.

Comments