我想知道你们是否可以向我展示如何在 Swift 中设置重置密码,我目前正在使用 Firebase 作为我的后端服务。我只需要代码。
答案就在API文档 https://firebase.google.com/docs/reference/ios/firebaseauth/api/reference/Classes/FIRAuth#/c:objc(cs)FIRAuth(im)sendPasswordResetWithEmail:completion::
-sendPasswordResetWithEmail:completion:
启动给定电子邮件地址的密码重置。
See FIR验证错误 https://firebase.google.com/docs/reference/ios/firebaseauth/api/reference/Classes.html#/c:objc(cs)FIRAuthErrors查看所有 API 方法通用的错误代码列表。
在 Swift 3.x 和 Firebase 3.x 中,它看起来像这样:
FIRAuth.auth()?.sendPasswordReset(withEmail: "email@email") { error in
// Your code here
}
Edit:
Firebase 4 更改了 Firebase 函数,使其与 Swift 中的命名约定更加一致。
Auth.auth().sendPasswordReset(withEmail: "email@email") { error in
// Your code here
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)