I'm working on android application which works as expected , but I'm using FirebaseUI to authenticate users login , I'm using this code for authentication and registration :
startActivityForResult(AuthUI.getInstance()
.createSignInIntentBuilder()
.setIsSmartLockEnabled(false)
.setAvailableProviders(Arrays.asList(
new AuthUI.IdpConfig.EmailBuilder().build(),
new AuthUI.IdpConfig.GoogleBuilder().build(),
new AuthUI.IdpConfig.FacebookBuilder().build()))
.build(),
RC_SIGN_IN);
Is there any way to know if the current user is new user after login using onActivityResult()
You can use cloud functions like this:
exports.sendWelcomeEmail = functions.auth.user().onCreate((event) => {
// ...
});
this function will trigger everytime a new user is created.
It will trigger when the following occurs:
more info here:
It is explained in the repo: https://github.com/firebase/FirebaseUI-Android/tree/master/auth#user-metadata
The easiest way is to compare last sign in time to the creation time on the user to determine if the user is new or existing.
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.