Avoid duplicate accounts in Firebase (email and phone) - firebase

I have an Firebase application that allow user to sign in with google account, or sign in by phone.
Assume user signed with Google.
In the next sigining, it tried sign with phone (A number that connected to its account),
I can't indicate that it is the same user. I think it is a new user.
But Google has the information that it is same account.
Is there a way I can know it?
(Google people API is not a good option.
Because it give me only the phone user has entered here: https://myaccount.google.com/profile
That it is not in wide use.
And it is not give me the recovery phone number)
I don't have to know the number of each user.
Only to know if phone X is connected to user Y.

Related

Phone still has a value even though I unlinked (firebase)

I used user.unlinkFromProvider('phone') to unlink a user's phone account, leaving them with only an email/password account. I looped through user.providerData to confirm the only providerId are firebase and password. However, printing user.phoneNumber, I still see the value of the previously added phone. I'm expecting this value to be null since I've removed/unlinked the phone number.
For anyone else who comes across this, a simple user.reload() will update the user data.

Is Firebase free version (spark) is sufficinet for project with almost 1000 active users per month?

I want to use firebase for backend as a service for my college project.
Docs are well elaborated but I have doubt in understanding what is the meaning of 10,000 phone auth per month. If one user login multiple times in a month is it considered as 1 auth or the number of times the user login.
Also, what is the limit of email authentications?
If I use sign-in with google or facebook is that is going to be counted in email authentication?
For Firebase Authentication's phone provider it is common that the user only signs in once, and not each time they start the app.
There is no documented limit on email authentication calls, although there is (undocumented) abuse protection.

ways to get chat id of a phone number in telegram bot

I want to know what are the ways to get the chat id of phone numbers in telegram bot programming. I have a small project that I need to get Chatid of a group of phone numbers in telegram very fast .
Telegram's API for now only allows bots interact with people using their ChatId.
Short Answer: There is no way provided by the API to achieve what you want.
Long Answer: You can manually add this number to your contact list and then send them a message with the link to your bot (for sure you need to send them something promising or else they will not open your bot). Once they click /start creating a function that stores the chat_id + firstname in a db so you can easily retrieve later then your bot can ask for the contact of the user so you can know which chat_id belongs to a particular phone number (if the user shares it with you then fine else at least you have the chat id which is important).
Sorry, you can't. Telegram bot API work in next scenario: User interact with Bot first and bot may ask for a message or for phone or for location. There is no way to send phone number and get chatId. You can ask user for a phone and in the response, you will give chat ID and Phone number of user if user will send phone number to the bot.
After it, you can campare revieved User's phone number with your database of phone number and append it with chatId.
Hope it help you.

How to update mobile number in angularfire2?

I am developing ionic app using angularfire2, I used google signin to login user and used phone auth to link phone number to user.
I linked phone number, now the scenario is to update mobile number. I searched on internet but I didn't found any suitable documentation to update mobile number using angularfire2. But I found that there is one method to update phone number i.e. updatePhoneNumber, but I am not sure with its parameters.
Can anyone help me with this to pass correct parameters to this method and update user's phone number.
The User.updatePhoneNumber() method takes a phoneCredential parameter, which you get from the ConfirmationResult that is sent with the verification text.

What kind of user consent is necessary for Firebase phone authentication?

The firebase phone auth documentation states:
Phone numbers that end users provide for authentication will be sent
and stored by Google to improve our spam and abuse prevention across
Google services, including but not limited to Firebase. Developers
should ensure they have appropriate end-user consent prior to using the
Firebase Authentication phone number sign-in service.
I believe I will have to display some sort of disclosure when asking for a user's phone number, but I'm not really sure what it should say. Can anyone provide an example? I used Digits/Fabric at one point, and it had a bunch of links to various privacy policies and ToS on the phone number collection screen, but now that they've joined with Firebase I'm kind of confused about what's necessary.
Thank you!
firebaser here
FirebaseUI-web displays the following before sending the SMS:
By tapping Verify, an SMS may be sent. Message & data rates may apply."
On the screen where the user enters the confirmation number, it displays:
By tapping Continue you are indicating that you agree to the Terms of Service
With the tos link being one that you as the developer provide. The reason it leaves the exact content open to you is that it partially depends on the jurisdiction that your app is under.
All we can do is tell you what we use the phone number for:
Phone numbers provided for authentication will be sent
and stored by Google to improve our spam and abuse prevention across
Google services, including but not limited to Firebase.

Resources