Facebook API:如果用户点击发送,则获得回复

时间:2014-01-29 20:11:22

标签: javascript facebook api

当我发送请求时,我需要找到用户是否点击了sendcancel。现在我有这个代码:

FB.init({
    appId: 'xxxxxxxxxxxxxx', 
    cookie: true,
    status: true, 
    xfbml: true, 
});

FB.ui({
    method: 'apprequests',
    message: 'click!',
    to: 'xxxxxxxxxx'
});

1 个答案:

答案 0 :(得分:0)

使用回调函数捕获响应。

FB.ui({
    method: 'apprequests',
    message: 'click!',
    to: 'xxxxxxxxxx'
},function (request, to) {
            if (request && to) {
                // User completed the request to at least 1 user
            }else{
                // User did not complete the request
            }
        });