gpt4 book ai didi

ios - 解析 Facebook logInWithPermissions 崩溃

转载 作者:行者123 更新时间:2023-11-29 02:16:58 30 4
gpt4 key购买 nike

我正在使用 Parse 开发一个 iOS 应用程序,并实现 Twitter 和 Facebook 登录。我的代码如下;

var permissions = NSArray(array: ["user_about_me"])
PFFacebookUtils.logInWithPermissions(permissions, {
(user: PFUser!, error: NSError!) -> Void in
if user == nil {
NSLog("Uh oh. The user cancelled the Facebook login.")
} else if user.isNew {
//Get data and fill in appropriate fields for PFUser
} else {
//login user
}
})

问题是,当我单击运行此代码的按钮时,出现以下文本错误:

Error: Error Domain=PF_AFNetworkingErrorDomain Code=-1016 "Expected content type {(
"text/json",
"application/json",
"text/javascript"
)}, got text/html" UserInfo=0x79faa000 {NSLocalizedRecoverySuggestion=Invalid OAuth Request, PF_AFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x7a174da0> { URL: https://api.parse.com/2/user_signup_or_login } { status code: 200, headers {
"Access-Control-Allow-Methods" = "*";
"Access-Control-Allow-Origin" = "*";
Connection = "keep-alive";
"Content-Length" = 21;
"Content-Type" = "text/html; charset=utf-8";
Date = "Sat, 21 Feb 2015 20:12:11 GMT";
Server = "nginx/1.6.0";
"X-Parse-Platform" = G1;
"X-Runtime" = "0.005746";
} }, NSErrorFailingURLKey=https://api.parse.com/2/user_signup_or_login, NSLocalizedDescription=Expected content type {(
"text/json",
"application/json",
"text/javascript"
)}, got text/html, PF_AFNetworkingOperationFailingURLRequestErrorKey=<NSMutableURLRequest: 0x7a165300> { URL: https://api.parse.com/2/user_signup_or_login }} (Code: 100, Version: 1.6.0)
2015-02-21 14:12:11.851 hotPotato[90663:4004200] Uh oh. The user cancelled the Facebook login.

看来我的“权限”数组有些地方不正确。但是,我想我已经关注了 Parse 的 instructions。完全保存我正在翻译成 swift 的事实。有什么想法吗?

最佳答案

这是1.6.2及以下版本的错误。将您的解析框架更新到 1 月 20 日发布的 1.6.3,它应该可以解决您的问题。

关于ios - 解析 Facebook logInWithPermissions 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28650842/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com