1

邀请用户参加现有活动的最佳方式是什么?我们想做以下事情:

  • 创建活动,公开
  • 在我们的(外部)网站上,给用户一个对话框(fb:multi-friend-selector)来选择他们的朋友来邀请参加活动

它建立了新的 Graph API 不能使用(http://bugs.developers.facebook.net/show_bug.cgi?id=10070),但是 REST API 的文档(http://developers.facebook.com /docs/reference/rest/events.invite)暗示不可能邀请用户参加现有活动。

如果有人能对此提供任何澄清,我将不胜感激 - 阅读模糊和矛盾的 facebook 文档让我无处可去。

具体来说,应该由谁/在哪里/如何创建事件?- 然后我如何从外部网站邀请用户参加该活动?

4

1 回答 1

1

这可以使用 Graph API 来完成。要使用 JavaScript SDK,请使用以下命令:

FB.api('/[EVENT-ID-HERE]/attending', 'post');

这只能在您拥有经过身份验证的用户后才能完成,因此完整的代码将是:

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
    appId: '[APP-ID-HERE]', cookie: true, status: true, xfbml: true
});
FB.Event.subscribe('auth.login', function (response) {
    if (response.session) {
        FB.api('/[EVENT-ID-HERE]/attending', 'post');
    }
});
</script>       
<fb:login-button perms="rsvp_event">Attend Event</fb:login-button>
于 2011-02-10T15:38:10.523 回答