2013-05-31 104 views
0

API錯誤代碼:191共享對話框中的Facebook UIAPI錯誤代碼:191共享對話框中的Facebook UI

我一直在試圖使FB.ui工作。 Unforunately,我不斷收到一個錯誤:如果我去我的應用程序的基本信息在https://developers.facebook.com/

我看不出有任何問題

An error occurred. Please try again later. 
API Error Code: 191 
API Error Description: The specified URL is not owned by the application 
Error Message: redirect_uri is not owned by the application. 

,一切都看起來不錯:

App ID: 471513259597047 
Display Name: Calculator 
Site URL: http://www.calculator.com 

我填一切都需要,但我仍然得到了191錯誤。順便說一句,我正在localhost中測試這個。

<html xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:fb="https://www.facebook.com/2008/fbml"> 
    <head> 
    <title>My Feed Dialog Page</title> 
    </head> 
    <body> 
    <div id='fb-root'></div> 
    <script src='http://connect.facebook.net/en_US/all.js'></script> 
    <p><a onclick='postToFeed(); return false;'>Post to Feed</a></p> 
    <p id='msg'></p> 

    <script> 
     FB.init({appId: "471513259597047", status: true, cookie: true}); 

     function postToFeed() { 

     // calling the API ... 
     var obj = { 
      method: 'feed', 
      redirect_uri: 'http://www.calculator.com', 
      link: 'https://developers.facebook.com/docs/reference/dialogs/', 
      picture: 'http://fbrell.com/f8.jpg', 
      name: 'Facebook Dialogs', 
      caption: 'Reference Documentation', 
      description: 'Using Dialogs to interact with people.' 
     }; 

     function callback(response) { 
      document.getElementById('msg').innerHTML = "Post ID: " + response['post_id']; 
     } 

     FB.ui(obj, callback); 
     } 

    </script> 
    </body> 
</html> 
+0

_「我正在按照以下方式在本地主機上測試這個」_ - 然後在您的應用設置中設置本地主機URL(並且不要明確設置redirect_uri,因爲在大多數情況下,軟件開發工具包)。 – CBroe

回答

0

我認爲,有URL之間有些不吻合,同時創造上developers.facebook.com Facebook應用程序,並在代碼中指定的URL指定,交叉檢查它。