2013-06-18 6 views
0

이번 주부터 내 iOS 앱에 FB 액세스 (iOS FB SDK 사용) 문제가 발생했습니다. 다음과 같은 오류가 발생합니다iOS SDK OAuthException HTTP 오류 코드 500

2013-06-18 15:44:16.756 foo-coffee[2441:907] Error: HTTP status code: 500 
2013-06-18 15:44:16.761 foo-coffee[2441:907] Errrror: Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x21051e70 {com.facebook.sdk:ParsedJSONResponseKey={ 
body =  { 
    error =   { 
     code = 1; 
     message = "An unknown error has occurred."; 
     type = OAuthException; 
    }; 
}; 
code = 500; 
}, com.facebook.sdk:HTTPStatusCode=500}, (null) 

오류는 다음과 같은 기능에서 발생 오류의

- (void)getFbFields:(CLLocationDegrees)lat longitude:(CLLocationDegrees)lng { 
NSString *fbquery = [NSString stringWithFormat:@"search?type=place&center=%f,%f&distance=3000&fields=name,cover", lat, lng]; 
[FBRequestConnection 
startWithGraphPath:fbquery 
completionHandler:^(FBRequestConnection *connection, 
        id result, 
        NSError *error) { 
    if (!error) { 
     [self readFbResponse:result]; 
    } else { 
     NSLog(@"Errrror: %@, %@", error, result); 
    } 
}]; 
} 

가능성이 FB "2013년 7월 10일 마이그레이션"이 될 수 있습니다. 여기에 내 개발자 계정에 Message : 액세스 토큰이없는 그래프 검색 끝점이 있습니다. July 10, 2013 Migration에 대한 로드맵에서

이 적혀있다 :

그래프 API 검색 사용자 액세스 토큰이 게시물, 장소 및 페이지를 제외한 모든 검색 그래프 API 호출에 필요합니다 변경합니다. 앱 액세스 토큰은 게시물 검색 그래프 API 호출에도 사용될 수 있습니다. 지역 정보 및 페이지 검색 그래프 API 호출에는 여전히 앱 액세스 토큰이 필요합니다. 응용 프로그램 검색은 더 이상 지원되지 않습니다.

그래서 "앱 액세스 토큰"이 필요합니다. '앱 액세스 토큰'을 가장 잘 통합하려면 어떻게해야합니까? 검색 URL의 매개 변수 또는 다른 방법으로?

답변

0

자신에게 액세스 토큰을 가져와 URL을 통해 전달해야합니다.

이러한 액세스 토큰을 가져 오기 위해 우리의 C# 코드 읽기 : 우리가 액세스 토큰을했으면

JsonObject response = (JsonObject) client.Get("oauth/access_token", new 
{ 
    client_id = __facebookAppID, 
    client_secret = __facebookAppSecret, 
    grant_type = "client_credentials" 
}); 

string accessToken = response["access_token"] as string; 

, 우리는 단지 URL에 추가, 예를 들어 :

path += "&access_token=" + accessToken;