FQL和Graph API在iOS中

有没有人在iOS使用graphicsAPI的FQL? 我正在尝试从不同的组获得用户的职位我已经阅读了FQL文档,但我需要看一个示例来帮助我继续? 请帮忙

这里是一个例子:

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

在最后一个iOS SDK中,Bertrand提到的方法不存在。 现在你应该这样做:

 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/

Interesting Posts