Skip to content Skip to sidebar Skip to footer

How To Softcode Firebase Storage Image Url's

I am using Firebase Storage to create and send image url's to Firebase Database. I have this working well when I have both a 'currentUser' and a Firebase Storage child reference

Solution 1:

@parohy Thanks for taking the time to search through the firebase docs. I think .once() only works with Firebase Realtime Database. And I'm looking for a unique name in Firebase Storage. However, your answer helped me come to my solution. I was trying to tap into the fact that Firebase Database already creates perfectly unique ids. However, I'm don't think I can access those in Firebase Storage. So I just did:

firebase.storage().ref().child(unique + '.jpg') 

const unique = Date.now() + Math.random(); 

not perfectly unique, but close enough.

Post a Comment for "How To Softcode Firebase Storage Image Url's"