使用FB.ui在apprequest中设置好友ID?

时间:2011-08-29 17:54:13

标签: javascript facebook facebook-graph-api

使用Facebook JS SDK(FB.ui),是否可以使用'apprequest'方法提供facebook用户ID的列表?

查看docs我看到你可以设置“to:”,但是我不确定这是否允许你发送用户id的json数组。任何帮助表示赞赏!

FB.ui({
    method: 'apprequests',
    to:[list of ids?], 
    message: 'You should learn more about this awesome game.', 
    data: 'tracking information for the user'
});

我需要将其发送给特定的列表用户,或者如果可能的话,在好友选择器中预先选中这些框。

2 个答案:

答案 0 :(得分:1)

怎么试试呢? 你总能做到

FB.ui({method: 'apprequests',to:4, message: 'You should learn more about this awesome game.', data: 'tracking information for the user'});

FB.ui({method: 'apprequests',to:5, message: 'You should learn more about this awesome game.', data: 'tracking information for the user'});

FB.ui({method: 'apprequests',to:6, message: 'You should learn more about this awesome game.', data: 'tracking information for the user'});

答案 1 :(得分:1)

您可以提供filters参数,该参数允许您拥有自定义用户列表。他们不会被预先选中,但你可以限制它,以便出现的唯一的朋友是你关心的人。

FB.ui({method: 'apprequests', message: 'Try this out!', filters: [{name: 'friends to invite', user_ids: [1, 2, 3, 4, 5]}, data: 'tracking data'});