简体   繁体   中英

How to Check is the user is for the first time in google sign in android

I am building an android application with java but when I am using the google sign-in auth with firebase time I don't know that is the user is already available in firebase auth.

BECAUSE: i want that if the user is not in firebase and just sign up with google then i will show him a screen where he can enter his bio (about) and if the user is already in firebase and sign in later I will not show him that bio screen

Thanks in Advance

您可以将登录用户的电子邮件存储在数据库中,并且在注册时您可以检查该电子邮件是否已经在数据库中。

It sounds like you're trying to store some profile information about your users in Firestore.

In that case, once the user is signed in, you should check if you already have a profile document for that user in the database. This is easiest if you use the ID of the user as the document ID in Firestore, for example Firebase Authentication's UID, or (if you're not using Firebase Authentication) Google's sign-in's account ID.

If the document exits, you know about the user already. If it doesn't exist, you'll want to send them to the profile screen to enter their bio.

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