0

I created an action that also publishes an object. I enabled publish_actions permissions. I can get my list of actions via: https://graph.facebook.com/me/myApp:myAction

but i can't get: https://graph.facebook.com/me/friends/myApp:myAction

Or do i need to just directly get a list of objects and somehow filter myself out? I actually can't figure out how to get the object list without calling it through the associated action. Is that just how it is?

WORKAROUND: First, I 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" and get back friends who have the app installed...

Second, I get back that query and use it to batch the following:

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];

Ugh. I also got a usable list with this 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"

But it doesn't return many items since it competes with the last 50 news items. Maybe it will be the way to go if the app is used enough, but it seems like use would drop off and then you couldn't get at the older posts easily.

4

1 回答 1

1

权限的文档中,您可以清楚地看到两个额外的权限,除了您已经拥有的“publish_actions”:

user_actions:APP_NAMESPACE

Friends_actions:APP_NAMESPACE

它指出:

允许您检索由应用程序命名空间指定的另一个应用程序发布的操作。例如,要请求检索由具有命名空间 awesomeapp 的应用程序发布的操作的能力,请提示用户输入 users_actions:awesomeapp 和/或 friends_actions:awesomeapp 权限。

于 2012-04-13T21:26:58.177 回答