How to update mobile number in angularfire2? - firebase

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.

Related

Build your own telegram client, how to use user name and password to log in/register without SMS verification code?

Build your own telegram client, how to log in/register with username and password without SMS verification code? I found an app in the past few days. The chat in it uses telegram, and then I studied telegram. The official documentation provides API, and I can develop a third-party client myself, but there is a problem. The official login and registration API, must use the verification code and the mobile phone number that has passed the verification code? This is very embarrassing. In the APP I found, he did not use the mobile phone number and verification code to verify, and he could log in and register directly? Do you know any big guys?
Here are my official issues: https://github.com/tdlib/td/issues/2131
In the end, I tracked down and found that he inherited TLObject and implemented two of his own (protocol or interface?) I want to figure it out, but I don't know where to start? I don't know if this is a custom telegram protocol or is it implemented in other ways?
But the difference from the official one is that he calls ConnectionsManager#native_init here to initialize, and finally passes in a parameter
However, there is no official one. At this point, there is basically no solution. I have searched the Internet and found no relevant introduction.

How to retrieve user's phone number from WeChat ID?

may I know if there is a way for me to retrieve a phone number from the WeChat MiniProgram sandbox given a WeChat ID?
WeChat documentation states that https://developers.weixin.qq.com/miniprogram/en/dev/framework/open-ability/getPhoneNumber.html
Calling the wx.login API is required before acquiring the user's mobile number linked to Weixin. As the API for acquiring the mobile number can be initiated only by a user’s trigger, click the [button]((button) component to trigger it rather than directly calling the API. Note: Currently, this API is applicable to non-individual developers, and the Mini Programs which have completed verification (not including overseas entities).
I've also inspected the WeChat MiniProgram's network activity and found a "mobile" field but it's encrypted.
"overseas entities" means company or organization not in china.Maybe your company entity can't use this API.
In common when user click the button with attribute of open-type="getPhoneNumber", you can get a code string at callback function.
Posting the code to server.
The server will take the code and token to get the phonebumber from wechat-offical server.The api path is "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=ACCESS_TOKEN".
Server docs "https://developers.weixin.qq.com/miniprogram/en/dev/api-backend/open-api/phonenumber/phonenumber.getPhoneNumber.html"
It's samiler as the process of get user's base information

Firebase Auth - Unable to Add Phone Number for Testing

I'm unable to add a phone number for testing my Firebase Phone Authentication workflow. See the images below:
Firebase Phone Auth Panel
After providing a valid phone number/verification code and clicking "Add", I get this error:
I've tried to register my device multiple times over the last two weeks with the same outcome. Hopefully someone has seen this before and if so, is there a solution?
UPDATE:
I've tried the following number formats with the same results -
+1 123-456-7890
+11234567890
Long story short, I was using my personal phone number as the number for test; which I successfully used on a previous Firebase-backed project with the same feature. I removed the test phone number from the Firebase project as I had finished testing the feature. I think it very well may be a bug on Firebase's end
I was successfully able to use the phone number "+1 111-111-1111"
UPDATE:
After successfully using the '+1 111-111-1111' phone number, deleting it, and trying to re-enter it, I was greeted with the same error
You need to delete the User phoneNumber in the authentication tab before you can add (or re-add) a phone number as a test phone number
First delete number for Authentication > User Tab.
Then add number now, it works perfectly.

PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 12500: , null)

when i create my first project on firebase to use google signin authentication. my app successfully run and completer google signin.
But when i develop my second project on the firebase i do the same thing like add SHA1 and add support email, but when i tried to google signin from my app , it shows
sign_in_failed, com.google.android.gms.common.api.ApiException: 12500
I don't know why this error come.
Is there any condition that
1) we can't use a same SHA1 key to a different apps.
2) we can't user the same email id for 'support email' inside the google sign for the two projects
or please tell me there is any other condition regarding the using of multiple project on a same account of firebase.
Input both SHA-1 and SHA256.
Make sure you have added a Support Email.
Update Google Play Services.
If all of these fail, delete your keystore and generate a new one.
These are the issues that cause that error.
I had this error ApiException: 12500 for a long time. I have tried everything:
remove my debugkeystore, recreate one
add a support email on the firebase console
change plugin versions
update google on my device
Nothing worked but looking for a solution I found:
I went to this page (https://console.developers.google.com/apis/credentials) Select your project from the list (top left). Then go to "Oauth consent screen"
I filled out the app's logo and link on the app's homepage and application's privacy policy link (with the project.firebaseapp.com), and then saved.
enter image description here
After that it was good. I believe the official documentation should be updated.
For more information visit this link
enter link description here

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