Skip to content

[Firebase Storage]: ref.getMetadata doesn't return property downloadURLs on iOS. returns relative url on Android #791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
escobar5 opened this issue Jan 29, 2018 · 7 comments
Assignees

Comments

@escobar5
Copy link

escobar5 commented Jan 29, 2018

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
@escobar5 escobar5 changed the title Firebase Storage: ref.getMetadata doesn't return property downloadURLs for public files [iOS] [Firebase Storage]: ref.getMetadata doesn't return property downloadURLs Jan 29, 2018
@escobar5 escobar5 changed the title [iOS] [Firebase Storage]: ref.getMetadata doesn't return property downloadURLs [Firebase Storage]: ref.getMetadata doesn't return property downloadURLs on iOS. returns relative url on Android Jan 29, 2018
@chrisbianca chrisbianca added the plugin: storage Firebase Cloud Storage label Jan 31, 2018
@chrisbianca
Copy link
Contributor

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

@chrisbianca chrisbianca added the Workflow: Waiting for User Response Blocked waiting for user response. label Feb 8, 2018
@escobar5
Copy link
Author

escobar5 commented Feb 8, 2018

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

@chrisbianca chrisbianca added type: bug New bug report and removed Workflow: Waiting for User Response Blocked waiting for user response. labels Feb 8, 2018
@chrisbianca
Copy link
Contributor

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.

@Salakar
Copy link
Contributor

Salakar commented Jul 1, 2018

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

@Salakar Salakar closed this as completed Jul 1, 2018
@Salakar
Copy link
Contributor

Salakar commented Jul 7, 2018

@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:

@Salakar Salakar added Workflow: Waiting for User Response Blocked waiting for user response. and removed type: bug New bug report labels Jul 7, 2018
@Salakar Salakar reopened this Jul 7, 2018
@escobar5
Copy link
Author

escobar5 commented Jul 9, 2018

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`;

@Salakar
Copy link
Contributor

Salakar commented Jul 9, 2018

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

@Salakar Salakar closed this as completed Jul 9, 2018
@Salakar Salakar added wontfix and removed Workflow: Waiting for User Response Blocked waiting for user response. labels Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants