How can I correct this facebook error?
I have a small facebook application where I want to publish a swf file to a user's wall and my wall.I have got this code so far.However, I am getting an error when I click on Click to share..How do I so开发者_如何学Crt this out?
<!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>
The error is
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.
The comment from Igy above is most likely correct. Under your applications advanced settings try disabling the stream post URL security option. This option forces you to essentially keep your links within your application so external references will fail.
精彩评论