我在使用FQL从Facebook获取数据时遇到问题。我目前想用封面图片网址从Facebook上取相册。为了获取封面图像,我必须进行查询以获取相册,然后使用相册ID来获取封面图像。因为我需要专辑的标题和封面图片。
我可以使用requestWithGraphPath执行单个FQL查询以获取相册列表。但不知道如何进行多查询。
这是我通过单一查询
获取相册的方式[facebook requestWithGraphPath:@“fql?q = SELECT + aid,name + FROM + album + WHERE + owner + = + me()”andDelegate:albums];
我在执行多查询时遇到问题...我已经查看了其他堆栈溢出并找到了这个:
FacebookAlbumCollection* albums = [[FacebookAlbumCollection alloc] init: self];
NSString* fql1 = [NSString stringWithFormat:
@"select aid,cover_pid,name from album where owner = me()"];
NSString* fql2 = [NSString stringWithFormat:
@"select pid from photo where pid in (select cover_pid from #albums)"];
NSString* fql = [NSString stringWithFormat:
@"{\"albums\":\"%@\",\"photos\":\"%@\"}",fql1,fql2];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObject:fql forKey:@"q"];
[facebook requestWithMethodName:@"fql.multiquery" andParams:params andHttpMethod:@"POST" andDelegate:albums];
有谁知道如何进行多重查询?