iPhone Facebook连接FQL查询以获取配置文件URL

时间:2010-05-27 13:46:49

标签: iphone facebook for-loop facebook-fql

上。

我正在使用Face book Connect FQL Queries来提取我的个人资料照片网址,即src_big,src_small网址。

但我总是在下面的委托

中获取空数组
  • (void)request:(FBRequest *)request didLoad:(id)result

我的FQL查询是。

NSString * fql = [NSString stringWithFormat:@“SELECT src_big,src_small FROM photo WHERE pid IN(SELECT cover_pid FROM album WHERE owner =%lld AND name ='Profile Pictures')”,session.uid]; NSDictionary * params = [NSDictionary dictionaryWithObject:fql forKey:@“query”]; [[FBRequest requestWithDelegate:self] call:@“facebook.fql.query”params:params];

但是 - (void)请求:(FBRequest *)请求didLoad:(id)结果总是返回空结果。

如果有任何错误,请任何人纠正我。

1 个答案:

答案 0 :(得分:0)

好的,我错了,我认为你需要一个multiquery + JSON演示文稿。这是我的代码

    NSString *albumFql = [NSString stringWithFormat:@"SELECT cover_pid, name FROM album WHERE owner =%lld", self.session.uid];
    NSDictionary *fqlsDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
                                    albumFql, @"album",
                                    nil];   
    NSDictionary *params = [NSDictionary dictionaryWithObject:[fqlsDictionary JSONRepresentation] forKey:@"queries"];
    [[FBRequest requestWithDelegate:self] call:@"facebook.fql.multiquery" params:params];