Firebase重设密码Swift [英] Firebase Reset Password Swift

查看:82
本文介绍了Firebase重设密码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.

推荐答案

答案在

-sendPasswordResetWithEmail:completion:

为给定的电子邮件地址启动密码重置.

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:

FIRAuth.auth()?.sendPasswordReset(withEmail: "email@email") { error in
    // Your code here
}

Firebase 4更改了Firebase功能,使其更符合Swift中的命名约定.

Firebase 4 changed the Firebase functions to be more aligned with the naming conventions in Swift.

Auth.auth().sendPasswordReset(withEmail: "email@email") { error in
    // Your code here
}

这篇关于Firebase重设密码Swift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆