Why do I keep getting "API Error Code: 191" when i try to open a simple feed dialog?

2k Views Asked by At

I want to give the user the option to publish a story to their feed from within a facebook-tab. I've tried to reduce the complicity of the code to find the error, but even with this bare bones-example I get the error:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>300 flaskor!</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body onLoad="publish();">

<div id="fb-root"></div>
<script src="//connect.facebook.net/en_US/all.js"></script>
<script>
  FB.init({
    appId  : 'MYAPPID',
    status : true, // check login status
    cookie : true, // enable cookies to allow the server to access the session
    xfbml  : true, // parse XFBML
    channelURL : '//MYDOMAIN.COM/channel.html', // Channel File
    oauth  : false // enable OAuth 2.0
  });

var publish = function() {

FB.ui(
  {
    method: 'feed',
    name: 'I like turtles!',
    link: 'http://www.facebook.com/MyFacebookPage',
   picture: 'http://MYDOMAIN.COM/logo.jpg',
    caption: 'Like us!',
    description: 'this is a test dialog'
  });

};

</script>
</body>

MYDOMAIN.COM is added as the app's domain in the application settings.

1

There are 1 best solutions below

0
On

I found the answer, it turns out it's as simple as setting a site-url in the app-settings.