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;
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
add a comment |
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
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
add a comment |
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
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
java
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
You can link an email/pass account with a phone account https://firebase.google.com/docs/auth/android/account-linking?authuser=0
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
You can link an email/pass account with a phone account https://firebase.google.com/docs/auth/android/account-linking?authuser=0
add a comment |
You can link an email/pass account with a phone account https://firebase.google.com/docs/auth/android/account-linking?authuser=0
add a comment |
You can link an email/pass account with a phone account https://firebase.google.com/docs/auth/android/account-linking?authuser=0
You can link an email/pass account with a phone account https://firebase.google.com/docs/auth/android/account-linking?authuser=0
answered Jul 1 at 7:03
MarkymarkMarkymark
70511 silver badges19 bronze badges
70511 silver badges19 bronze badges
add a comment |
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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