检查event-rsvp状态,并显示禁用/启用的RSVP按钮 [英] Checking for event-rsvp status and showing disabled/enabled RSVP-button

查看:159
本文介绍了检查event-rsvp状态,并显示禁用/启用的RSVP按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍然不清楚我如何在文档中找到这一点,但是我想检查登录的用户是否已经回复到fb事件,并显示我 m参加按钮取决于...我已经有登录按钮连接和适当的权限(user_events和rsvp_event),只是不知道如何使用JS SDK。

$ b你可以查询 event_member FQL表,类似于:

  FB.api(
{
method:'fql.query',
query:'从event_member中选择rsvp_status,其中eid =EVENT_ID,uid = me()'
},function(response){
alert(response [0] .rsvp_status);
}
);

将返回(提醒):拒绝


I'm still a bit unsure how I would find this in the documentation, but I'd like to check whether the logged-in user has RSVP'ed to an fb-event or not, and show the "I'm attending" button depending on that... I've already got the login-button hooked up and the proper permissions (user_events and rsvp_event), just not sure how to go about this using the JS SDK.

解决方案

You can query the event_member FQL table, something like:

FB.api(
    {
        method: 'fql.query',
        query: 'select rsvp_status from event_member where eid = "EVENT_ID" and uid=me()'
    }, function(response) {
        alert(response[0].rsvp_status);
    }
);

Would return (alert) something like: declined

这篇关于检查event-rsvp状态,并显示禁用/启用的RSVP按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆