Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Am I able to load another users profile image in firebase android?

Am I able to load another users profile image if I have their email but I'm logged in as another user?

like image 533
Sam321pbs Avatar asked Oct 22 '25 03:10

Sam321pbs


2 Answers

If you are using Firebase Storage then technically yes, it's just a file system that you can retrieve any file from. Users won't have access to this without forging your app/obtaining the api key.

It's your app that is in control of retrieving the correct image for a user, Firebase Storage doesn't have the concept of security other than your app signing key being associated with the FireBase project/your app having the API key to use that particular FireBase project's storage.

like image 79
CodeChimp Avatar answered Oct 24 '25 14:10

CodeChimp


No, you are only able to get the information for the currently logged in user using the Firebase Auth library. (I'm assuming that's what you're asking because the documentation doesn't say this explicitly, so it is very confusing.)

To support accessing the user profile image for another user, you should store the image using something else like Firebase Database or Firebase Storage, and then query those when you're logged in as another user.

Here's a related Stack Overflow thread:

Firebase how to get user details?

like image 43
Chris Ricca Avatar answered Oct 24 '25 12:10

Chris Ricca