简体   繁体   中英

Is it Possible to upload a profile Picture along with the registration to the Fire base server?

I am working on an Android application which stores the profile picture along with the registration like name, email, phone number, password etc.
The user registration works perfectly.
The problem is that I want to create the profile with all of the above attributes.
I wasn't able to understand how is this possible in a single activity.

There is no way to do that with authentication. However you can create database instance and add user details based on userId returned from firebase authentication

For example while authentication if i will get userId fgjhyhsfjk5425 , then i will add data with that key and other details inside it.

fgjhyhsfjk5425:{
    name:abc
    profile:url
    age:25
}

Firebase user takes display name and email id of the user. You can save your extra data in firebase database and you can also save the download URL of the profile picture in the firebase database.

Like this:

{
  "name@provider,com" : {
    "displayName" : "Full Name",
    "phoneNumber" : 1234567890,
    "profilePicUrl" : "your url retrieved from firebase storage"
  },

Add extra details if you want. hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM