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의 지침을 따랐을 때 신속하게 번역하고 있다는 사실을 정확히 저장했다고 생각합니다. 어떤 아이디어?
버전 1.6.2 이하의 오류입니다. 구문 분석 프레임 워크를 1 월 20 일에 출시 된 1.6.3으로 업데이트하면 문제가 해결 될 것입니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다