2011-06-18 37 views
0

我需要发送的邀请函使用的要求,我用对话框。该代码的朋友后回重定向到我的网站Facebook的apprequests“的方法,并请求对话框

function newInvite(){ 
      var receiverUserIds = FB.ui({ 
        method : 'apprequests', 
        message: 'Come on man checkout my applications. visit http://ithinkdiff.net', 
      }, 
      function(receiverUserIds) { 
         console.log("IDS : " + receiverUserIds.request_ids); 
        } 
      ); 

我使用新的PHP SDK(3.0 )。

在此先感谢。

+0

如果你只是需要知道谁邀请谁,你不需要这个。当受邀请用户敲击请求并进入页面时,您可以获得这些信息,您可以读出请求(您需要将其删除),并且您拥有发送和接收用户的用户名。 – Rufinus

+0

@rufinus我不知道这是可能的。我在Facebook的印象之下排除了它,并以某种方式提供,以便任何人都无法追踪邀请。你能多解释一下吗? – Ashfame

+0

请参阅http://pastebin.com/acX5tvKu – Rufinus

回答

1

编辑:对不起,我想我误解了。你正试图在这里捕捉收件人ID吗?


尽管您已经声明了PHP SDK,但是您的代码使用的是JS SDK。这里是你如何做到这一点在JS:

FB.ui({ 
    method:'apprequests', 
    message:'I want you to try this app', 
    // to:123456798, // for sending to specific users 
    // filters:['app_non_users'], // commented: let users send notifications to app users too, probably a good idea to make them revisit? 
    data:'' // send data what you would like to track, FB will send that back in the URL for us 
}); 
相关问题