2016-03-05 41 views
5

我想知道如果你們能告訴我如何在Swift中設置重置密碼,我目前使用Firebase作爲我的後端服務。我只需要代碼。Firebase重置密碼Swift

+0

見https://www.firebase.com/docs/ios/guide/login/password.html#section-reset-email –

+0

如果你有一個具體的問題:顯示您已經什麼試過。請參閱http://stackoverflow.com/help/how-to-ask –

回答

25

答案是在API documentation

-sendPasswordResetWithEmail:completion:

啓動對指定電子郵件地址的密碼重置。

請參閱FIRAuthErrors以獲取所有API方法共有的錯誤代碼列表。

在斯威夫特3.x和火力地堡3.x的它看起來就像這樣:

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

編輯:

火力地堡4改變了火力地堡的功能與命名約定中更一致迅速。

Auth.auth().sendPasswordReset(withEmail: "[email protected]") { error in 
    // Your code here 
} 
+0

謝謝各位! – Tyge

+0

如果我的回答是正確的,請接受它! :-) – Jay

+0

謝謝@Jay +1 for you –