FQL and Graph API in iOS

前端 未结 2 622
陌清茗
陌清茗 2020-12-08 23:54

have anyone used FQL of graph API in iOS? I am trying to get users posts from different groups I have read FQL documentation but I need to see an example to help me proce

2条回答
  •  孤街浪徒
    2020-12-09 00:18

    In the last iOS SDK, the method mentioned by Bertrand doesn't exists. Now you should do it this way:

    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
    }];
    

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

提交回复
热议问题