【发布时间】:2012-04-13 20:38:12
【问题描述】:
我创建了一个也发布对象的操作。 我启用了 publish_actions 权限。 我可以通过以下方式获取我的操作列表: https://graph.facebook.com/me/myApp:myAction
但我无法得到: https://graph.facebook.com/me/friends/myApp:myAction
或者我是否需要直接获取对象列表并以某种方式将自己过滤掉? 如果不通过关联的操作调用它,我实际上无法弄清楚如何获取对象列表。就是这样吗?
解决方法: 首先,我 fql.query "select uid, name, is_app_user from user where uid in (select uid2 from friend where uid1=me()) and is_app_user=1" 并找回安装了应用的朋友...
第二, 我取回该查询并使用它来批处理以下内容:
for (NSDictionary *d in friendsWithApp) {
NSString *jsonRequest = [NSString stringWithFormat:@"{ \"method\": \"GET\", \"relative_url\": \"%@/myApp:myAction/myObject\" }", [d objectForKey:@"uid"]];
jsonRequestsArray = [jsonRequestsArray stringByAppendingString:jsonRequest];
setCount++;
if (setCount!=[presets count]) {
jsonRequestsArray = [jsonRequestsArray stringByAppendingString:@", "];
}
}
jsonRequestsArray = [jsonRequestsArray stringByAppendingString:@" ]"];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObject:jsonRequestsArray forKey:@"batch"];
[facebook requestWithGraphPath:@"me" andParams:params andHttpMethod:@"POST" andDelegate:self];
呃。我还得到了这个 fql.query 的可用列表:
“SELECT post_id, actor_id, attribution FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid=me() AND type='newsfeed') AND app_id = MY_APP_ID”
但它不会返回很多项目,因为它与最后 50 个新闻项目竞争。如果该应用程序使用得足够多,也许这将是一条路,但似乎使用率会下降,然后您就无法轻松访问较旧的帖子。
【问题讨论】:
标签: ios facebook facebook-graph-api batch-file facebook-fql