2012-08-28 22 views
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,不论我是否通过属性值或没有。)

预先感谢任何帮助。

+0

查看您在facebook.com上的活动档案 - 该活动是否显示在那里? – CBroe

+0

是的,我检查,它不在,也没有在我的时间表上,当我尝试直接使用ID返回时打开帖子,我得到'页面未找到'的错误。 – inarilo

+0

当您使用Graph API Explorer并在那里检查'/ me/xyznamespace:actionname'时,它会显示吗? (请务必在首位顶部的下拉列表中选择正确的应用,因为只有创建应用可以看到它已发布的操作。) – CBroe

回答

0

尝试通过get方法和相同的ID获取帖子,并检查帖子是否回来。这可能是该帖子对您不可见的原因。

+0

我试过了,它说没有找到页面。 – inarilo

相关问题