尝试通过批量请求获取所有用户的 Facebook 好友信息:
NSString *jsonRequest1 = @"{ \"method\": \"GET\", \"relative_url\": \"me/friends?fields=name,picture\" }";
NSString *jsonRequestsArray = [NSString stringWithFormat:@"[%@]", jsonRequest1];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObject:jsonRequestsArray forKey:@"batch"];
[facebook requestWithGraphPath:@"me" andParams:params andHttpMethod:@"POST" andDelegate:self];
个人资料图片尺寸较小 (50x50),我需要指定照片的尺寸。我一直在查看图形 API 文档,并且正在努力将两者联系在一起 - 这是相关链接:http://developers.facebook.com/docs/reference/api/user/
它说要将以下参数添加到请求中,但正如我所说,我不确定如何将两者联系在一起:
picture?type=large
我确信它适用于特定用户的单个请求,但我无法通过批处理请求。
感谢您的帮助,它可能正盯着我的脸!
最佳答案
FQL 有一些像 Facebook 所说的优势
FQL, the Facebook Query Language, allows you to use a SQL-style interface to query data exposed by the Graph API. It provides advanced features not available in the Graph API, including batching multiple queries into a single call.
看看这个来自 Facebook 的教程。
https://developers.facebook.com/docs/howtos/run-fql-queries-ios-sdk/
但我建议使用带有 Field Expansion 的 Graph API,这比 FQL 更有帮助且更容易理解。请注意,Graph API 并不支持所有子字段。
https://developers.facebook.com/docs/reference/api/field_expansion/
祝你好运!
关于iphone - Facebook Graph API - 批量请求大型个人资料图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12145931/