예제 #1
0
    // Begin authentication with the phone number.
    public void VerifyPhoneNumber()
    {
        //		ToastScript.instance.ToastShow ("VerifyPhoneNumberEnter");
        var phoneAuthProvider = Firebase.Auth.PhoneAuthProvider.GetInstance(auth);

        phoneAuthProvider.VerifyPhoneNumber(phoneNumberInput.text, phoneAuthTimeoutMs, resendtoken,
                                            verificationCompleted: (cred) => {
            //				UpdateUserProfileAsync(phoneNumberInput.text);
            //				Debug.Log("Phone Auth, auto-verification completed");
            //				ToastScript.instance.ToastShow ("Phone Auth, auto-verification completed");
            //				auth.SignInWithCredentialAsync(cred).ContinueWith(HandleSigninResult);
        },
                                            verificationFailed: (error) => {
            Loading.SetActive(false);
            Debug.Log("Phone Auth, verification failed");
            ToastScript.instance.ToastShow("Enter In-Valid Phone Number");
        },
                                            codeSent: (id, token) => {
            phoneAuthVerificationId = id;
            resendtoken             = token;
            Debug.Log("Phone Auth, code sent And Verify Email");
            ToastScript.instance.ToastShow("Phone Auth, code sent");
            Loading.SetActive(false);
            PhoneOTPVerifyUIObj.SetActive(true);
        },
                                            codeAutoRetrievalTimeOut: (id) => {
            Debug.Log("Phone Auth, auto-verification timed out");
            ToastScript.instance.ToastShow("Phone Auth, auto-verification timed out");
            Loading.SetActive(false);
        });
    }
예제 #2
0
    // Begin authentication with the phone number.
    public void VerifyPhoneNumber()
    {
        var phoneAuthProvider = Firebase.Auth.PhoneAuthProvider.GetInstance(auth);

        phoneAuthProvider.VerifyPhoneNumber(parentEmailInput.text, phoneAuthTimeoutMs, resendtoken,
                                            verificationCompleted: (cred) => {
            Debug.Log("Phone Auth, auto-verification completed");
//				Constants.ParentUDID = auth.CurrentUser.UserId;
//				Constants.ParentEmail = auth.CurrentUser.Email;
//				Constants.ParentPassword = passwordInput.text;
            ToastScript.instance.ToastShow("Login in progress...");
//				SceneManager.LoadScene ("ProfileView");
            if (!sentcode)
            {
                auth.SignInWithCredentialAsync(cred).ContinueWith(HandleSigninPhoneResult);
            }
        },
                                            verificationFailed: (error) => {
            Loading.SetActive(false);
            Debug.Log("Phone Auth, verification failed");
            ToastScript.instance.ToastShow("Enter In-Valid Phone Number", 4f);
        },
                                            codeSent: (id, token) => {
            phoneAuthVerificationId = id;
            resendtoken             = token;
            ToastScript.instance.ToastShow("Phone Auth, code sent");
            sentcode = true;
            Debug.Log("Phone Auth, code sent");
            Loading.SetActive(false);
            PhoneOTPVerifyUIObj.SetActive(true);
        },
                                            codeAutoRetrievalTimeOut: (id) => {
            Debug.Log("Phone Auth, auto-verification timed out");
            ToastScript.instance.ToastShow("Phone Auth, auto-verification timed out");
            Loading.SetActive(false);
        });
    }