Mobile OTP Verification without signing in using Firebase Phone AuthSMS authentication on android NullPointerExceptionWriting my own exception classUnable to see multiple marker on google MapLogin activity with volley, php, mysql after login success intent not go to other activityCannot Verify phone number using firebase authenticationHow to verify phone number using firebase authenticationFirebase OTP verification without signin in androidSearch Firestore query don't show data in RecycleViewFirebase Phone Auth OTP is not Human Readable Formathow can I get the products of the sellersGoogle Play License Verification Library with flutter

Does two puncture wounds mean venomous snake?

How to add label AFTER drawing a path

Can ads on a page read my password?

Is the evolution operator well-defined mathematically?

Secure my password from unsafe servers

Is there a loss of quality when converting RGB to HEX?

Looking for a new job because of relocation - is it okay to tell the real reason?

What would happen to an adventurer's personal identity when turning into a God?

Unexpected route on a flight from USA to Europe

Why does the ultra long-end of a yield curve invert?

Does it make sense to occupy open space?

Colleagues speaking another language and it impacts work

laravel create new project throws exception

Should I self-publish my novella on Amazon or try my luck getting publishers?

Could one become a successful researcher by writing some really good papers while being outside academia?

Is TA-ing worth the opportunity cost?

Did WWII Japanese soldiers engage in cannibalism of their enemies?

Double blind peer review when paper cites author's GitHub repo for code

Acceptable to cut steak before searing?

Is Odin inconsistent about the powers of Mjolnir?

Why should public servants be apolitical?

Finish the Mastermind

How quickly could a country build a tall concrete wall around a city?

In Pokémon Go, why does one of my Pikachu have an option to evolve, but another one doesn't?



Mobile OTP Verification without signing in using Firebase Phone Auth


SMS authentication on android NullPointerExceptionWriting my own exception classUnable to see multiple marker on google MapLogin activity with volley, php, mysql after login success intent not go to other activityCannot Verify phone number using firebase authenticationHow to verify phone number using firebase authenticationFirebase OTP verification without signin in androidSearch Firestore query don't show data in RecycleViewFirebase Phone Auth OTP is not Human Readable Formathow can I get the products of the sellersGoogle Play License Verification Library with flutter






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








4















I am currently making an android app where I need to verify if the user is entering correct mobile number using the OTP.
The user is already signed in the application using his email and password.
Now I need to verify the mobile number the user enters without using the signInWithCrendntial() method of firebase phone auth.
How do i go about it ?



My mCallbacks is



 @Override
public void onVerificationCompleted(PhoneAuthCredential credential)
Toast.makeText(getApplicationContext(), "Verification Complete", Toast.LENGTH_SHORT).show();

showMessage("Success!!","OTP verified!" + credential);
cred = credential;
//btn_add_guest.setEnabled(true);



@Override
public void onVerificationFailed(FirebaseException e)
Toast.makeText(getApplicationContext(), "Verification Failed", Toast.LENGTH_SHORT).show();
Log.i(TAG,"Error is "+e.getMessage());


@Override
public void onCodeSent(String verificationId,
PhoneAuthProvider.ForceResendingToken token)
Toast.makeText(getApplicationContext(), "Code Sent", Toast.LENGTH_SHORT).show();
mVerificationId = verificationId;
mResendToken = token;

Log.i(TAG,"VERFICATION ID IS"+mVerificationId);
Log.i(TAG,"RESEND TOKEN"+mResendToken);
btn_add_guest.setEnabled(false);

};


I m calling this method on button Pressed where put_otp is textView where user enters the OTP.



verifyPhoneNumberWithCode(mVerificationId,put_otp.getText().toString());
PhoneAuthCredential credential = PhoneAuthProvider.getCredential(mVerificationId, put_otp.getText().toString());
Log.i(TAG,credential.getProvider());

private void verifyPhoneNumberWithCode(String verificationId, String code)

Log.i(TAG,"RESEND TOKEN IN METHOD IS"+mResendToken); if(code.equals(mResendToken)&&verificationId.equals(mVerificationId))
Toast.makeText(AddGuestActivity.this, "Verification Success", Toast.LENGTH_SHORT).show();

btn_add_guest.setEnabled(true);

else
Toast.makeText(this,"Please provide correct OTP",Toast.LENGTH_SHORT).show();










share|improve this question


























  • For mobile number enter is there different screen??

    – Piyush
    Mar 27 at 7:10











  • Mobile number is on the same screen. There is no different screen for the same.

    – Khushboo Gandhi
    Mar 27 at 10:12











  • You should have a look at this answer.

    – Rumit Patel
    Apr 1 at 13:35

















4















I am currently making an android app where I need to verify if the user is entering correct mobile number using the OTP.
The user is already signed in the application using his email and password.
Now I need to verify the mobile number the user enters without using the signInWithCrendntial() method of firebase phone auth.
How do i go about it ?



My mCallbacks is



 @Override
public void onVerificationCompleted(PhoneAuthCredential credential)
Toast.makeText(getApplicationContext(), "Verification Complete", Toast.LENGTH_SHORT).show();

showMessage("Success!!","OTP verified!" + credential);
cred = credential;
//btn_add_guest.setEnabled(true);



@Override
public void onVerificationFailed(FirebaseException e)
Toast.makeText(getApplicationContext(), "Verification Failed", Toast.LENGTH_SHORT).show();
Log.i(TAG,"Error is "+e.getMessage());


@Override
public void onCodeSent(String verificationId,
PhoneAuthProvider.ForceResendingToken token)
Toast.makeText(getApplicationContext(), "Code Sent", Toast.LENGTH_SHORT).show();
mVerificationId = verificationId;
mResendToken = token;

Log.i(TAG,"VERFICATION ID IS"+mVerificationId);
Log.i(TAG,"RESEND TOKEN"+mResendToken);
btn_add_guest.setEnabled(false);

};


I m calling this method on button Pressed where put_otp is textView where user enters the OTP.



verifyPhoneNumberWithCode(mVerificationId,put_otp.getText().toString());
PhoneAuthCredential credential = PhoneAuthProvider.getCredential(mVerificationId, put_otp.getText().toString());
Log.i(TAG,credential.getProvider());

private void verifyPhoneNumberWithCode(String verificationId, String code)

Log.i(TAG,"RESEND TOKEN IN METHOD IS"+mResendToken); if(code.equals(mResendToken)&&verificationId.equals(mVerificationId))
Toast.makeText(AddGuestActivity.this, "Verification Success", Toast.LENGTH_SHORT).show();

btn_add_guest.setEnabled(true);

else
Toast.makeText(this,"Please provide correct OTP",Toast.LENGTH_SHORT).show();










share|improve this question


























  • For mobile number enter is there different screen??

    – Piyush
    Mar 27 at 7:10











  • Mobile number is on the same screen. There is no different screen for the same.

    – Khushboo Gandhi
    Mar 27 at 10:12











  • You should have a look at this answer.

    – Rumit Patel
    Apr 1 at 13:35













4












4








4








I am currently making an android app where I need to verify if the user is entering correct mobile number using the OTP.
The user is already signed in the application using his email and password.
Now I need to verify the mobile number the user enters without using the signInWithCrendntial() method of firebase phone auth.
How do i go about it ?



My mCallbacks is



 @Override
public void onVerificationCompleted(PhoneAuthCredential credential)
Toast.makeText(getApplicationContext(), "Verification Complete", Toast.LENGTH_SHORT).show();

showMessage("Success!!","OTP verified!" + credential);
cred = credential;
//btn_add_guest.setEnabled(true);



@Override
public void onVerificationFailed(FirebaseException e)
Toast.makeText(getApplicationContext(), "Verification Failed", Toast.LENGTH_SHORT).show();
Log.i(TAG,"Error is "+e.getMessage());


@Override
public void onCodeSent(String verificationId,
PhoneAuthProvider.ForceResendingToken token)
Toast.makeText(getApplicationContext(), "Code Sent", Toast.LENGTH_SHORT).show();
mVerificationId = verificationId;
mResendToken = token;

Log.i(TAG,"VERFICATION ID IS"+mVerificationId);
Log.i(TAG,"RESEND TOKEN"+mResendToken);
btn_add_guest.setEnabled(false);

};


I m calling this method on button Pressed where put_otp is textView where user enters the OTP.



verifyPhoneNumberWithCode(mVerificationId,put_otp.getText().toString());
PhoneAuthCredential credential = PhoneAuthProvider.getCredential(mVerificationId, put_otp.getText().toString());
Log.i(TAG,credential.getProvider());

private void verifyPhoneNumberWithCode(String verificationId, String code)

Log.i(TAG,"RESEND TOKEN IN METHOD IS"+mResendToken); if(code.equals(mResendToken)&&verificationId.equals(mVerificationId))
Toast.makeText(AddGuestActivity.this, "Verification Success", Toast.LENGTH_SHORT).show();

btn_add_guest.setEnabled(true);

else
Toast.makeText(this,"Please provide correct OTP",Toast.LENGTH_SHORT).show();










share|improve this question
















I am currently making an android app where I need to verify if the user is entering correct mobile number using the OTP.
The user is already signed in the application using his email and password.
Now I need to verify the mobile number the user enters without using the signInWithCrendntial() method of firebase phone auth.
How do i go about it ?



My mCallbacks is



 @Override
public void onVerificationCompleted(PhoneAuthCredential credential)
Toast.makeText(getApplicationContext(), "Verification Complete", Toast.LENGTH_SHORT).show();

showMessage("Success!!","OTP verified!" + credential);
cred = credential;
//btn_add_guest.setEnabled(true);



@Override
public void onVerificationFailed(FirebaseException e)
Toast.makeText(getApplicationContext(), "Verification Failed", Toast.LENGTH_SHORT).show();
Log.i(TAG,"Error is "+e.getMessage());


@Override
public void onCodeSent(String verificationId,
PhoneAuthProvider.ForceResendingToken token)
Toast.makeText(getApplicationContext(), "Code Sent", Toast.LENGTH_SHORT).show();
mVerificationId = verificationId;
mResendToken = token;

Log.i(TAG,"VERFICATION ID IS"+mVerificationId);
Log.i(TAG,"RESEND TOKEN"+mResendToken);
btn_add_guest.setEnabled(false);

};


I m calling this method on button Pressed where put_otp is textView where user enters the OTP.



verifyPhoneNumberWithCode(mVerificationId,put_otp.getText().toString());
PhoneAuthCredential credential = PhoneAuthProvider.getCredential(mVerificationId, put_otp.getText().toString());
Log.i(TAG,credential.getProvider());

private void verifyPhoneNumberWithCode(String verificationId, String code)

Log.i(TAG,"RESEND TOKEN IN METHOD IS"+mResendToken); if(code.equals(mResendToken)&&verificationId.equals(mVerificationId))
Toast.makeText(AddGuestActivity.this, "Verification Success", Toast.LENGTH_SHORT).show();

btn_add_guest.setEnabled(true);

else
Toast.makeText(this,"Please provide correct OTP",Toast.LENGTH_SHORT).show();







java android firebase firebase-authentication






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 at 7:00









Doug Stevenson

103k11 gold badges120 silver badges145 bronze badges




103k11 gold badges120 silver badges145 bronze badges










asked Mar 27 at 6:45









Khushboo GandhiKhushboo Gandhi

312 bronze badges




312 bronze badges















  • For mobile number enter is there different screen??

    – Piyush
    Mar 27 at 7:10











  • Mobile number is on the same screen. There is no different screen for the same.

    – Khushboo Gandhi
    Mar 27 at 10:12











  • You should have a look at this answer.

    – Rumit Patel
    Apr 1 at 13:35

















  • For mobile number enter is there different screen??

    – Piyush
    Mar 27 at 7:10











  • Mobile number is on the same screen. There is no different screen for the same.

    – Khushboo Gandhi
    Mar 27 at 10:12











  • You should have a look at this answer.

    – Rumit Patel
    Apr 1 at 13:35
















For mobile number enter is there different screen??

– Piyush
Mar 27 at 7:10





For mobile number enter is there different screen??

– Piyush
Mar 27 at 7:10













Mobile number is on the same screen. There is no different screen for the same.

– Khushboo Gandhi
Mar 27 at 10:12





Mobile number is on the same screen. There is no different screen for the same.

– Khushboo Gandhi
Mar 27 at 10:12













You should have a look at this answer.

– Rumit Patel
Apr 1 at 13:35





You should have a look at this answer.

– Rumit Patel
Apr 1 at 13:35












1 Answer
1






active

oldest

votes


















0














You can link an email/pass account with a phone account https://firebase.google.com/docs/auth/android/account-linking?authuser=0






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55371291%2fmobile-otp-verification-without-signing-in-using-firebase-phone-auth%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You can link an email/pass account with a phone account https://firebase.google.com/docs/auth/android/account-linking?authuser=0






    share|improve this answer





























      0














      You can link an email/pass account with a phone account https://firebase.google.com/docs/auth/android/account-linking?authuser=0






      share|improve this answer



























        0












        0








        0







        You can link an email/pass account with a phone account https://firebase.google.com/docs/auth/android/account-linking?authuser=0






        share|improve this answer













        You can link an email/pass account with a phone account https://firebase.google.com/docs/auth/android/account-linking?authuser=0







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jul 1 at 7:03









        MarkymarkMarkymark

        70511 silver badges19 bronze badges




        70511 silver badges19 bronze badges





















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55371291%2fmobile-otp-verification-without-signing-in-using-firebase-phone-auth%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

            155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해