0

I am storing users profile images in firebase. Firebase gives me back urls like this one https://firebasestorage.googleapis.com/v0/b/offere-5ad35.appspot.com/o/USERS%2Fqy5SNzVlI7ZNIFeWVnNSZfv1cy22%2Fprof_picture.jpg?alt=media&token=61fab7ff-8f1d-46fb-a1e2-5ffc8be0b00e.

Which seeems to download the image rather than displaying it in browser. Meaning I can not use it in my React Native image tags. Is there a way to convert this into just a normal Image resource URL.

Or do I have to fetch it and store it on device manually?

Robert Lemiesz
  • 1,026
  • 2
  • 17
  • 29

1 Answers1

0

I tripped myself up here.

The problem was that I was trying to set <Image source={url} />, and I was getting the console warning of "Attempted to set an invalid source for Image component.

The problem was not that the url was invalid, but rather that I should have been using this syntax

<Image source={{uri: https://firebasestorage.googleapis.com/v0/b/offere-5ad35.appspot.com/o/USERS%2Fqy5SNzVlI7ZNIFeWVnNSZfv1cy22%2Fprof_picture.jpg?alt=media&token=61fab7ff-8f1d-46fb-a1e2-5ffc8be0b00e.}}

Robert Lemiesz
  • 1,026
  • 2
  • 17
  • 29