Firebase重设密码Swift [英] Firebase Reset Password Swift
问题描述
我想知道你们是否可以告诉我如何在Swift中设置重置密码",我目前正在使用Firebase作为后端服务.我只需要代码.
I was wondering if you guys could show me how to setup Reset Password in Swift, I am currently using Firebase as my backend service. I just need the code.
推荐答案
答案在 为给定的电子邮件地址启动密码重置. Initiates a password reset for the given email address. 请参见FIRAuthErrors 列出所有API方法共有的错误代码. See FIRAuthErrors for a list of error codes that are common to all API methods. 在Swift 3.x和Firebase 3.x中,它看起来像这样: In Swift 3.x and Firebase 3.x it will look like this: Firebase 4更改了Firebase功能,使其更符合Swift中的命名约定. Firebase 4 changed the Firebase functions to be more aligned with the naming conventions in Swift. 这篇关于Firebase重设密码Swift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! -sendPasswordResetWithEmail:completion:
FIRAuth.auth()?.sendPasswordReset(withEmail: "email@email") { error in
// Your code here
}
Auth.auth().sendPasswordReset(withEmail: "email@email") { error in
// Your code here
}