如何更正此Facebook错误?

时间:2011-09-30 10:39:16

标签: javascript facebook

我有一个小的facebook应用程序,我想将swf文件发布到用户的墙壁和我的墙上。到目前为止我已经有了这个代码。但是,当我点击Click to share..How时出现错误我可以解决这个问题吗?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="../JQuery/JQuery.js"></script>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">

    function publishStream(targetId, name, links, picture, source, userName,message) {
    FB.ui(
            {
                 method: 'feed',
                 to: targetId,
                     name: name,
                 link: links,
                     picture: picture,
                 source:  source, // The URL of a media file (e.g., a SWF or video file) attached to this post
                     caption: 'Shared by '+userName,
                     actions:  {name: 'Try App', link: links},
                     message: message

            },
            function(response){
                 if (response && response.post_id) {
                  //alert('Post was published.');
                 } else {
                  // alert('Post was not published.');
                 }
        });
    }
</script>
</head>

<body>


<p onclick="publishStream('id', 'name', 'http://t2.gstatic.com/images?q=tbn:ANd9GcSclvwUe23dKnjge54JJH6kQM-8iyTRBT_N5-TCWojVmcD0bTi8YQ', 'http://t2.gstatic.com/images?q=tbn:ANd9GcSclvwUe23dKnjge54JJH6kQM-8iyTRBT_N5-TCWojVmcD0bTi8YQ', 'http://t2.gstatic.com/images?q=tbn:ANd9GcSclvwUe23dKnjge54JJH6kQM-8iyTRBT_N5-TCWojVmcD0bTi8YQ','username','Hello') ">Click to share</p>
</body>
</html>

错误是

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.

1 个答案:

答案 0 :(得分:0)

以上Igy的评论很可能是正确的。在您的应用程序高级设置下,尝试禁用流后URL安全性选项。此选项会强制您基本上将链接保留在应用程序中,以便外部引用失败。