Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i can't use verifyPhoneNumber #76

Open
kamhawy4 opened this issue Dec 8, 2019 · 4 comments
Open

i can't use verifyPhoneNumber #76

kamhawy4 opened this issue Dec 8, 2019 · 4 comments

Comments

@kamhawy4
Copy link

kamhawy4 commented Dec 8, 2019

hi all i can't use verifyPhoneNumber i dont know if this true or no This is the first time for me to do something like this

problem - I did not receive my verification code

  • These are the steps that I've taken

1 - enable the Phone Number sign-in method.

2 - I wrote a number in Phone numbers for testing (Sign-in Method)

3 - install cordova-plugin-firebase-authentication

4 - run this function

cordova.plugins.firebase.auth.verifyPhoneNumber("+20 ************", 60).then(function(verificationId) { console.log(verificationId); // pass verificationId to signInWithVerificationId });

not found any error but not send receive my verification code

@chemerisuk
Copy link
Owner

You may have experienced instant signin on a known device (Android only). Subscribe to onAuthStateChanged to handle such cases:

cordova.plugins.firebase.auth.onAuthStateChanged(function(userInfo) {
    if (userInfo) {
        // user was signed in
    } else {
        // user was signed out
    }
});

@imranaalam
Copy link

Have you added you domain in google phone auth domain names from which verification request can be received?

@vorkapps
Copy link

Did you ever get this working?
When I try the verifyPhoneNumber(phone, timeout) using the number of the installed SIM, the auto-verification occurs despite that I put timeout = 0, I do not receive an SMS and the .then() does not get executed at all, hence there is no verificationId to use in firebase.auth.signInWithCredential() and get the user authenticated for other firebase funcitons.
When I put a phone number of a DIFFERENT SIM than the one installed (I have a 2nd phone with a different number), I RECEIVE the SMS on the 2nd phone, and the .then() function GETS EXECUTED as expected!
Is there a way to either: (a) fix the handling of the timeout=0 and properly receive the SMS and call the .then() function? or (b) receive the verificationId in the onAuthStateChanged event handler, so that we can authenticate the user from code running on this handler instead of the .then() function?
Thanks!

@charlesmudy
Copy link

charlesmudy commented Aug 28, 2021

@chemerisuk can you help here pelase? Not getting any response at all even with this function

cordova.plugins.firebase.auth.onAuthStateChanged(function(userInfo) {
			window.fn.load("signup.html");
			if (userInfo) {
				console.log("In");
			} else {
				console.log("Out");
			}
		});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants