2012-08-28 21 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

相關問題