我刚刚完成了电影我的应用程序到解析服务器。除了我的Twitter登录和注册外,我已经完成了所有工作。当我登录或注册时,我收到打印到我的控制台的内部服务器错误消息。我正在使用最新的Parse SDK。这里是我的登录代码(我的注册代码是相似的,它只是会从Twitter的API等数据,并将其存储到我的数据库):ParseTwitterUtils内部服务器错误
PFTwitterUtils.logInWithBlock {
(user: PFUser?, error: NSError?) -> Void in
if let user = user {
if user.isNew {
spinningActivity.hideAnimated(true)
PFUser.currentUser()?.deleteInBackground()
self.displayNoticeWithTwoActions("Account Not Found", message: "This Twitter account is not in our system. You have to sign up first.", firstButtonTitle: "Sign Up", closeButtonTitle: "Ok", segue: "dontHaveAccountSegue")
} else if error != nil {
spinningActivity.hideAnimated(true)
self.displayError("Error", message: error!.localizedDescription)
} else {
spinningActivity.hideAnimated(true)
self.performSegueWithIdentifier("successfulLoginSegue", sender: self)
}
} else {
spinningActivity.hideAnimated(true)
self.displayError("Error", message: "Unless you tapped on 'Cancel' or 'Done', something went wrong. Please try again.")
}
}
我能在网上找到的唯一的事情是,它可能是一个问题在推特的最后......我确信我的消费者密钥和秘密在我的AppDelegate中是正确的。有任何想法吗?
你必须到你的Twitter身份验证密钥添加到您的解析服务器的配置文件 – pbush25
在我情况下,我在Heroku上使用Parse Server。这是否意味着我会将一个密钥TWITTER_AUTH添加到密钥列表中?建议我将我的Facebook密钥添加到列表中吗? Facebook登录和注册在没有服务器上列出的密钥的情况下工作。我感谢您的帮助! –