2011-02-09 6 views
8

iOS에서 그래프 API의 FQL을 사용하는 사람이 있습니까? 다른 그룹의 사용자 게시물을 얻으려고합니다 FQL 문서 을 읽었지만 계속 진행할 수 있도록 예제가 필요합니까? 도와주세요iOS의 FQL 및 그래프 API

답변

11

여기 예입니다

NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
           @"SELECT uid,name FROM user WHERE uid=4", @"query", 
           nil]; 
[facebook requestWithMethodName: @"fql.query" 
         andParams: params 
        andHttpMethod: @"POST" 
         andDelegate: self]; 
8

마지막 아이폰 OS SDK, 버트 랜드에 의해 언급 된 방법에서 수행 존재하지.

NSString *query = [NSString stringWithFormat:@"YOUR_QUERY_HERE"]; //begins from SELECT........ 

NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
           query, @"q", 
           nil]; 

FBRequest *request = [FBRequest requestWithGraphPath:@"/fql" parameters:params HTTPMethod:@"GET"]; 

[request startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) { 
    //do your stuff 
}]; 

//or you can do it also with the following class method: 

[FBRequestConnection startWithGraphPath:@"/fql" parameters:params HTTPMethod:@"GET" completionHandler:^(FBRequestConnection *connection, 
              id result, 
              NSError *error) { 
    //do your stuff 
}]; 

출처 : https://developers.facebook.com/docs/howtos/run-fql-queries-ios-sdk/

지금 당신은 이런 식으로해야