0
这是我的代码当尝试后FB的动作,我得到一个ID,但没有被公布
window.fbAsyncInit = function() {
FB.init({
appId : 'xxxxxxxxxxxxx', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// Additional initialization 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));
function postscore(){
FB.login(function(response){
if (response.authResponse)
{
var uid = response.authResponse.userID;
FB.api('/'+uid+'/xyznamespace:actionname?access_token='+response.authResponse.accessToken, 'post', { objectname: document.location.href, customproperty: 85, 'fb:explicitly_shared':true }, function(response1) {
if (!response1 || response1.error) {
alert(response1.error.message);
} else {
alert('Post ID: ' + response1.id);
}
});
}
},
{scope:'publish_actions'});
return false;
}
我得到的响应ID,但无后是越来越创建。我究竟做错了什么?
另外,我可以像我一样传递属性值吗?或者会被忽略?
(返回的ID,不论我是否通过属性值或没有。)
预先感谢任何帮助。
查看您在facebook.com上的活动档案 - 该活动是否显示在那里? – CBroe
是的,我检查,它不在,也没有在我的时间表上,当我尝试直接使用ID返回时打开帖子,我得到'页面未找到'的错误。 – inarilo
当您使用Graph API Explorer并在那里检查'/ me/xyznamespace:actionname'时,它会显示吗? (请务必在首位顶部的下拉列表中选择正确的应用,因为只有创建应用可以看到它已发布的操作。) – CBroe