Convert anonymous acccount to Phone Number Account

喜你入骨 提交于 2019-12-08 09:14:34

问题


Looking at the Firebase Authentication documentation it looks like one could only link an anonymous account to either email, Google or Facebook, but there is no specific statement regarding this question.

Because I was unable to find any clear method in the API that would allow to convert to a phone number account, I was wondering whether or not there is any possibility to accomplish this.


回答1:


You can also connect an anonymous account with an account for phone number authentication. Similar to all the example on the documentation you linked, you'll use the credential(withVerificationID: verificationCode:) method of the provider. So something like:

guard let authentication = user.authentication else { return }
let credential = PhoneAuthProvider.credential(withVerificationID: authentication.idToken,
                                              verificationCode: verificationCode)


来源:https://stackoverflow.com/questions/52578119/convert-anonymous-acccount-to-phone-number-account

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!