【发布时间】:2016-06-18 21:56:43
【问题描述】:
我想知道你们是否可以告诉我如何在 Swift 中设置重置密码,我目前正在使用 Firebase 作为我的后端服务。我只需要代码。
【问题讨论】:
-
如果您遇到特定问题:展示您已经尝试过的内容。见stackoverflow.com/help/how-to-ask
标签: ios swift passwords firebase reset
我想知道你们是否可以告诉我如何在 Swift 中设置重置密码,我目前正在使用 Firebase 作为我的后端服务。我只需要代码。
【问题讨论】:
标签: ios swift passwords firebase reset
-sendPasswordResetWithEmail:completion:为给定的电子邮件地址启动密码重置。
请参阅FIRAuthErrors 了解所有 API 方法共有的错误代码列表。
在 Swift 3.x 和 Firebase 3.x 中,它看起来像这样:
FIRAuth.auth()?.sendPasswordReset(withEmail: "email@email") { error in
// Your code here
}
编辑:
Firebase 4 更改了 Firebase 函数,使其更符合 Swift 中的命名约定。
Auth.auth().sendPasswordReset(withEmail: "email@email") { error in
// Your code here
}
【讨论】: