这是我的代码
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。)
提前感谢您的帮助。