这是我的代码:
window.fbAsyncInit = function() {
FB.init({
appId: "xxx",
xfbml: true,
version: "v2.6"
});
FB.Event.subscribe('send_to_messenger', function(response) {
// callback for events triggered by the plugin
console.log('inside the send_to_messenger');
if ( response.event == 'clicked' ) {
};
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) { return; }
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
现在,我如何获得用户的PSID?
答案 0 :(得分:1)
您需要订阅messaging_optins
webhook事件。单击“发送到信使”按钮后,您应该在事件的sender.id
道具中获得PSID。