ios - 解析服务器密码重置电子邮件错误ios

标签 ios swift parse-platform passwords parse-server

我有一个 Parse iOS 应用程序,我希望用户能够使用它来重置其帐户密码。我尝试使用标准解析密码电子邮件重置功能与此代码。但它返回了此错误:“密码重置功能需要 appName、publicServerURL 和 emailAdapter。”。我对此进行了研究,发现我可能需要 MailGun 或其他电子邮件服务来托管我的电子邮件重置。真的吗?或者有其他方法可以解决此错误吗?

PFUser.requestPasswordResetForEmailInBackground(myEmail, block: { (success, error) -> Void in
           if error == nil {

               print("Password Reset Email Sent")

           } else {


               print(error)
           }
       })

最佳答案

//标记:- 忘记密码按钮

@IBAction func forgotPasswButt(_ sender: AnyObject) {
    let alert = UIAlertController(title: APP_NAME,
                                  message: "Type your email address you used to register.",
                                  preferredStyle: .alert)


    let ok = UIAlertAction(title: "Reset password", style: .default, handler: { (action) -> Void in
        // TextField (optional))
        let textField = alert.textFields!.first!
        let txtStr = textField.text!

        PFUser.requestPasswordResetForEmail(inBackground: txtStr, block: { (succ, error) in
            if error == nil {
                self.simpleAlert("You will receive an email shortly with a link to reset your password")
            }})
    })

    // Cancel button
    let cancel = UIAlertAction(title: "Cancel", style: .destructive, handler: { (action) -> Void in })

    // Add textField
    alert.addTextField { (textField: UITextField) in
        textField.keyboardAppearance = .dark
        textField.keyboardType = .default
    }

    alert.addAction(ok)
    alert.addAction(cancel)
    present(alert, animated: true, completion: nil)

}

关于ios - 解析服务器密码重置电子邮件错误ios,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39887013/

相关文章:

Android 推送通知未接收/未发送

ios - 为什么在 Swift 中转换成本如此之高,而不是……将其保留为 AnyObject?

iphone - 在可重用表格单元格中使用 NSCache 和 dispatch_async 的正确方法是什么?

ios - 如何在 iOS 中实现可以处理多个 API 调用的数据模型?

ios - Parse 1.7.3 崩溃报告

ios - 使用代码创建新的 PFUser,无需以此新 PFUser 身份登录

ios - 如何将单元格添加到静态部分 UITableView?

ios - SpriteKit didBeginContact 没有被调用

ios - 相机 View 不会出现在 swift/objective-c++ (opencv) 项目中 - ios 10.3 xcode 8

在导航到其他 View 时快速保存用户坐标