Verify phone number in React Native with Firebase? - firebase

I thought after firebase version 3.0.0 phone Auth would be integrated. However, I keep getting the error that firebase.auth().verifyPhoneNumber() is not a function (Node.js). I am currently working with react native, which means I am using the web API. Does anyone know how to proceed from here?
"firebase": "^4.8.0",
EDIT: I am implementing facebook, google and email as sign-in methods. My app however, requires that the users verifies his/ her phone number. All I see in the docs is how to signIn via SMS but no verification.
Thanks in advance!

When you signInWithPhoneNumber, you are essentially verifying a user's phone number. You could sign in with Facebook/Google and then linkWithPhoneNumber/updateWithPhoneNumber to the currentUser. This would update the user's phone number and verify ownership too. Phone number authentication has been supported in Firebase since version 4.x.x. BTW, this doesn't work out of the box for react-native. You would need to use a similar approach to this: Ionic2 authentication firebase

Related

Is it possible admin of app can see the firebase sms verification code

Is it possible admin of app can see the firebase sms verification code As we are developing an application used by farmers mostly in remote places around globe, There is an issue in login using OTP if it is possible that admin can see the OTP(mostly not receiving OTP due to network issues), we will be login at the other end(admin) and make it possible for the users to use the app.
No, Firebase Authentication doesn't let you see the code. You'll have to build a custom solution for it.

Email verification without having a FirebaseUser

I'm trying to send a verification email without having a firebaseUser, is it possible ?
I know i can do it with user.sendEmailVerification() method but can i do it just by giving an email from a textfield ?
Based on what I knew and what I've read from the documentation, it looks like it's not possible to do this. A Firebase user, a.k.a an user authenticated within Firebase platform is required if you want to send email verification that uses Firebase Email Vetification service.
Well, do not lose hope since there are plenty workarounds to do this. What I would do to achieve this is to use Firebase Cloud Functions to create serverless API platform. I connect Firebase Cloud Functions with Firebase Admin SDK (which also has access to other Firebase services if I am not mistaken).
I send an email using some kind of email service providers such as SendGrid to designated email address (which the app got from user's inputted email) and provide a link to verify there (in the e-mail that sent to designated email address). Then, in the cloud functions, you leverage Firebase Admin SDK to change verification status.
This approach is flexible though, as it can be used to verify a user not only with Firebase Authentication.
Hope it helps. If it's not clear for you, just comment.
Happy coding.
EDIT: After thoroughly read your question again, I realized that my answer is not fully correct. Somehow you still need a specific user to be added within Firebase Authentication database, which you would not want to do manually and let your app do so instead. Perhaps you can use Firebase Admin SDK in this matter. You can read official Firebase documentation for more information regarding Admin SDK.

How to get how many PhoneAuth used Firebase

I'm using Firebase blaze plan. How can I get how many Phone Auth (SMS) used and how many left in this month with API request?
There is no API to retrieve the usage details of phone authentication. The quota/usage is only available in the Firebase console.
You can find the information in the Authentication > Usage tab of your Firebase console.
If you're actually using phone number verification, your chart will look more interesting than mine above. :)

How does FirebaseUI/Firebase auth authenticate a mobile number without OTP after 1st attempt?

I am using FirebaseUI and Firebase authentication to authenticate users using phone number. During testing I saw that when I first used my phone number I was sent an OTP but after that I have uninstalled and installed my app many times but now it does not ask for OTP and just verifies the phone number and logs me in. So I would like to know how is firebaseUI/auth doing it. Is it linking android device Id to a phone number or saving it in shared preferences which is saved on cloud?
If this is not the case how is firebase UI/auth doing it ? . My app only has location permission.
Firebase tries to keep some data in your device even if it was deleted. It is called making backups.
I think this is related to my question
You just need to add these lines in your manifest file inside application tag:
android:allowBackup="false"
android:fullBackupContent="false"

Firebase Phone Number Authentication Issue

I am using firebase in my project for phone number verification.
A few phone numbers have this issue. Alert like
"There seems to be a problem with your project's firebase phone number authentication set-up, please make sure to follow the instructions found at https:// firebase.google.com/docs/auth/ios/phone-auth"
Any idea where to look next? Thanks in advance.
Alert Msg Screenshot
You get this message if the user has disabled notifications.
To use phone number authentication, your app must be able to receive
silent APNs notifications from Firebase.
https://firebase.google.com/docs/auth/ios/phone-auth

Resources