Ejemplo n.º 1
0
 // Sign-in with an email and password.
 public Task SigninWithEmailAsync()
 {
     DebugLog(string.Format("Attempting to sign in as {0}...", email));
     DisableUI();
     if (signInAndFetchProfile)
     {
         return(auth.SignInAndRetrieveDataWithCredentialAsync(
                    EmailAuthProvider.GetCredential(email, password)).ContinueWith(
                    HandleSignInWithSignInResult));
     }
     return(auth.SignInWithEmailAndPasswordAsync(email, password)
            .ContinueWith(HandleSignInWithUser));
 }
Ejemplo n.º 2
0
    // Sign in using phone number authentication using code input by the user.
    protected void VerifyReceivedPhoneCode()
    {
        var phoneAuthProvider = Firebase.Auth.PhoneAuthProvider.GetInstance(m_auth);
        // receivedCode should have been input by the user.
        var cred = phoneAuthProvider.GetCredential(phoneAuthVerificationId, receivedCode);

        if (signInAndFetchProfile)
        {
            m_auth.SignInAndRetrieveDataWithCredentialAsync(cred).ContinueWithOnMainThread(
                HandleSignInWithSignInResult);
        }
        else
        {
            m_auth.SignInWithCredentialAsync(cred).ContinueWithOnMainThread(HandleSignInWithUser);
        }
    }