In a Firebase Function, I am retrieving newly created objects from Firebase Storage as follows. the operation works, but in production environments I get the Google Storage URL (Not Publicly Accessible) instead of Firebase Storage URL (Publicly Accessible)
exports.myFunc = functions.storage.object().onFinalize(async (object) => {
// the following prints
// https://storage.googleapis.com/download/storage/v1/b/<bucket>/o/<filename>?generation=<generation>&alt=media (not publicly accessible)
// instead of
// https://firebasestorage.googleapis.com/v0/b/<bucket>/o/<filename>?alt=media&token=<token> (publicly accessible)
console.log(object.mediaLink)
}
I am expecting to see the https://firebasestorage.googleapis.com... URL since this is the one that works for public access. is this a known bug or do I need to do something else in order to retrieve the public URL?