React-native-firebase: [Firebase Storage]: ref.getMetadata doesn't return property downloadURLs on iOS. returns relative url on Android

Created on 29 Jan 2018  路  7Comments  路  Source: invertase/react-native-firebase

Issue

On iOS the getMetadata() object doesn't have the property downloadURLs

Firebase docs

On Android it does return the property, but the url is relative (eg. /images/img.png)

I've tried getting the metadata using firebase's web sdk and it does returns the property and the url is absolute.

Environment

  1. Application Target Platform: Both

  1. Development Operating System: macOS High Sierra

  1. Build Tools: (not relevant)

  1. React Native version: 0.51.0

  1. RNFirebase Version: 3.2.2

  1. Firebase Module: Storage
Android iOS Storage

Most helpful comment

Ok, thanks for confirming - I've flagged it as a bug that we'll look at once we've got our messaging rewrite out of the way.

All 7 comments

@escobar5 have you tried using the ref's getDownloadUrl() method?

@chrisbianca yes, but I need the updated metadata also, so it would be better to do just one request

Ok, thanks for confirming - I've flagged it as a bug that we'll look at once we've got our messaging rewrite out of the way.

Thanks for reporting this issue. We're aware that Storage has fallen behind slightly on React Native Firebase and would like to bring it up to speed again. I will close this issue for now and track it as well as other issues collectively over on the Storage improvements proposal to be addressed in a future release. See #1260

@escobar5 confused as to where you're reading that getMetadata() has a downloadURLs property, none of the firebase docs for js, ios or android show that as existing:

https://firebase.google.com/docs/reference/ios/firebasestorage/api/reference/Classes/FIRStorageMetadata#file
https://firebase.google.com/docs/reference/js/firebase.storage.FullMetadata
https://firebase.google.com/docs/reference/android/com/google/firebase/storage/StorageMetadata


Loving react-native-firebase and the support we provide? Please consider supporting us with any of the below:

I can't find it, maybe it was removed in some version, I looked into my code and I'm not using that property anymore. I'm constructing the URL like this:

var uri = `https://firebasestorage.googleapis.com/v0/b/${metadata.bucket}/o/${encodeURIComponent(metadata.fullPath||metadata.name)}?alt=media`;

@escobar5 ok I'll close this issue for now then. Thanks for your responses

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mahyarr picture mahyarr  路  3Comments

alizahid picture alizahid  路  3Comments

romreed picture romreed  路  3Comments

n-scope picture n-scope  路  3Comments

Damnum picture Damnum  路  3Comments