How to save additional data to the Firebase user account with Ionic app?

Asked

Viewed 254 times

0

Hello I am using firebase authentication in my Ionic app, my question is : how can I save more data besides email and password in the user account?

I want to save beyond the high email like: First name, last name, date of birth,

Can someone give me a Help?

1 answer

0

In this case, you will probably want to do a CRUD (Create, Read, Update and Delete). This video shows you how to do.

Considering that you already have integrations with firebase, just go to your project page in firebase, in the database tab, and create a database.

Then using the Angularfirestore:

import {AngularFirestore} from '@angular/fire/firestore';

Creates methods for adding and searching user:

    interface User {
             nome?: string;
             sobrenome?: string;
             dataNascimento?: string;
             celular?: string;
            }

   constructor(private afs: AngularFirestore) {
            var user:User = {
            nome: "Nome",
            sobrenome: "Sobrenome",
            dataNascimento: "Data de Nascimento",
            celular: "Número de celular",
            };
            this.afs.collection<User>('Users').add(user);
    }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.