Check if user is authenticated for the first time in Firebase Google Authentication in Android

后端 未结 8 1413
一向
一向 2020-11-30 06:16

I am using Firebase Authentication in an Android application, and I am using Google account authentication as an option to sign in to the application.

How can I know

相关标签:
8条回答
  • 2020-11-30 07:03

    This may help you and try it:

    Correct code location to check Firebase if a user has been created already?

    0 讨论(0)
  • 2020-11-30 07:04

    In Firebase UI, JAVA:

     @Override
        protected void onActivityResult(int requestCode, int resultCode, Intent data) {
            super.onActivityResult(requestCode, resultCode, data);
            Intent i;
    
    
            if (requestCode == RC_SIGN_IN) {
                IdpResponse response = IdpResponse.fromResultIntent(data);
    
                if (resultCode == RESULT_OK) {
    
    
                    if(response.isNewUser()){
                    Log.d(TAG, "onActivityResult: isNewUser "+response.isNewUser());
    } else {
    
                    // Successfully signed in
                    }
    
                    // ...
                } else {
    
    
    
    //               handle error
                }
            }
        }
    
    
    0 讨论(0)
提交回复
热议问题