2014-10-27 208 views
0

我創建了一個應用程序,我試圖通過Facebook邀請朋友邀請朋友js方法,但所有工作正常,但沒有通知發送給該朋友。通知不發送給Facebook朋友

我的應用程序鏈接:http://www.huzoorbux.com/fl/app/android/www/homepage_nopost.html

我的代碼:

<script src="http://connect.facebook.net/en_US/all.js"></script> 
     <script> 
     FB.api(
    "/me/invitable_friends", 
    function (response) { 
     if (response && !response.error) { 
     /* handle the result */ 
     } 
    } 
); 
     if(top.location != self.location) { 
       top.location = self.location 
      } 
      FB.init({ 
       appId:'228877127299395', 
       cookie:true, 
       status:true, 
       xfbml:true 
      }); 

      function FacebookInviteFriends() 
      { 
       FB.ui({ 
        method: 'apprequests', 
        message: 'Join My Job Buddy' 
       }); 
      } 
     </script> 

<a href='#' onclick="FacebookInviteFriends();"><div class="connectbutton5" id="ol">Invite Friends</div></a> 

回答

1

App請求僅用於遊戲,可能是這個原因。並始終使用一個回調函數進行錯誤處理,也許你錯過了一個錯誤:

FB.ui({method: 'apprequests', 
    message: 'YOUR_MESSAGE_HERE' 
}, function(response){ 
    console.log(response); 
}); 

另外:

The invitable_friends API is only available for games that have a Facebook Canvas app implementation using version 2.0 of the Graph API.

來源:https://developers.facebook.com/docs/games/invitable-friends/v2.1

如果你想邀請某人到一個網站,使用發送和共享對話框和按鈕。你甚至不需要爲他們授權用戶。