1

海。

我正在使用 Facebook 连接 FQL 查询来提取我的个人资料照片 URL,即 src_big,src_small URL。

但我总是在下面的委托中得到空数组

  • (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* 参数 = [NSDictionary dictionaryWithObject:fql forKey:@"query"]; [[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];

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

如果有任何错误,任何人都可以纠正我。

4

1 回答 1

0

好的,我错了,我认为你需要一个多查询 + 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];
于 2010-05-27T13:57:26.657 回答