如何在 Android 的 Firebase 身份验证中更改登录电话号码? [英] How to change the Signed in Phone Number in Firebase Authentication for Android?

查看:25
本文介绍了如何在 Android 的 Firebase 身份验证中更改登录电话号码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Android Firebase Auth Ui在 android 应用程序中提供基于电话号码的登录选项.我正在尝试为登录用户提供一个额外的选项,将他们的登录电话号码切换到另一个保持相同用户帐户的号码.

I am using Android Firebase Auth Ui for providing Phone Number based sign in option in an android app. I am trying to provide an additional option to signed in users to switch their signed in phone number to another number keeping the same user account.

但根据 Firebase Docs for Phone number 没有选项更改登录号码.

But as per Firebase Docs for Phone number there are no options to change the signed in number.

可以选择将不同的身份验证提供商(如电子邮件、谷歌或 Facebook 登录等)链接到同一帐户.但是没有提到如何更改电话号码或电子邮件 ID 保持相同的用户 ID.

There are options for linking different auth providers like email, google or Facebook login etc to same account. But there is no way mentioned about how to change the phone number or email id keeping the same user id.

是否有解决方法或方法可以实现这一目标?

Is there a workaround or method by which we can achieve this?

推荐答案

存在用于更新当前用户电话号码的 API:FirebaseUser#updatePhoneNumber(PhoneAuthCredential 凭据)

An API exists for updating the phone number of a current user: FirebaseUser#updatePhoneNumber(PhoneAuthCredential credential)

这篇关于如何在 Android 的 Firebase 身份验证中更改登录电话号码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆