android - Firebase users setting phone number -
i have been authenticating user facebook on firebase want make them set phone numbers linked user cant find way make them set phone number can retrieve using firebaseuser user.getphonenumber , update phonenumber needs credentials not string don't know how use can me ?!
firebaseuser user = firebaseauth.getinstance().getcurrentuser(); user.getphonenumber();
user.updatephonenumber();
firebase auth verifies own phone numbers. doesn't populate facebook phone numbers after facebook sign-in or of like. however, if have phone number, need go through verification process: verifyphonenumber
phone number verificationid , ask user sms code, populate phone auth credential using verification id/code , call user.updatephonenumber(phonecredential)
.
alternatively, if verified phone number via other means, can send user id token , phone number server. using firebase admin node.js sdk, verify id token , call updateuser
api phone number: https://firebase.google.com/docs/auth/admin/manage-users#update_a_user user.reload()
user on client update phone number.
Comments
Post a Comment