我尝试用预先指定的收件人弹出对话框:
FB.init({
appId : 'MYAPPID',
status : true,
cookie : true,
xfbml : true,
frictionlessRequests: true
});
function sendRequestToRecipients()
{
FB.ui({method: 'apprequests',
message: 'You have just received a PP request.',
to: '100000526845569'
}, requestCallback);
}
sendRequestToRecipineds();
弹出窗口打开时出现错误:An error occurred. Please try later
当我查看弹出窗口的请求URL时,我看到以下内容:
我认为有些信息尚未发送:
api_key, app_id
为什么?有什么想法吗?
登录facebook完美无缺。多朋友选择器也是。
<script>
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId : 'MYAPPID', // App ID from the App Dashboard
channelUrl : '//mydomain.com/channel.html', // Channel File for x-domain communication
status : true, // check the login status upon init?
cookie : true, // set sessions cookies to allow your server to access the session?
xfbml : true, // parse XFBML tags on this page?
frictionlessRequests: true
});
};
// Load the SDK's source Asynchronously
(function(d, debug){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all" + (debug ? "/debug" : "") + ".js";
ref.parentNode.insertBefore(js, ref);
}(document, /*debug*/ false));
function sendRequestToRecipients() {
FB.ui({method: 'apprequests',
message: 'You have just received a PP request.',
to: '100000143396036'
}, requestCallback);
}
function sendRequestViaMultiFriendSelector() {
FB.ui({method: 'apprequests',
message: 'My Great Request'
}, requestCallback);
}
function requestCallback(response) {
// Handle callback here
}
</script>
这就是它在这里制作的方式
答案 0 :(得分:1)
尝试异步加载javascript SDK,然后再调用FB.init()
(如果还没有),请执行以下操作:
<script>
window.fbAsyncInit = function()
{
FB.init({
appId : APP_ID,
status : true,
cookie : true,
xfbml : true,
frictionlessRequests: true
});
//Additional Code here
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}
(document));
</script>
答案 1 :(得分:1)
固定。
很奇怪,但是ASYNC SDK的存在让一切都搞砸了。
谢谢