I'm trying to call FB.ui
to make a wall post in an iframe. However, when I set display to iframe, I get a 102 error "Iframe dialogs must be called with a session key"
. I have an access token, I'm logged in, everything else seems to be working (I can even post directly to the stream with PHP without bringing up the prompt). Any ideas?
PHP:
require_once('facebook.php');
define('APP_ID',"276733022359677");
define('APP_SECRET',"xxxx");
$my_url = URI_B."/spider/";
$config = array();
$config['appId'] = APP_ID;
$config['secret'] = APP_SECRET;
$facebook = new Facebook($config);
$fbid = $facebook->getUser();
if($fbid == 0){
$scope = "";
header("Location: ".$facebook->getLoginUrl($scope));
}
Javascript:
FB.init({appId: "276733022359677", status: true, cookie: true});
function publish() {
var obj = {
display: 'iframe',
method: 'feed',
link: 'http://discussiontopic.comyr.com/spider/',
name: 'Test',
caption: 'Test Caption',
description: 'This is a test.'
};
FB.ui(obj);
}
I also get an unspecified error at the login page (if redirected there to log in).
If you have the user's access token, specify it as a parameter to the FB.ui
call:
var obj = {
display: 'iframe',
access_token: '<%= $access_token %>',
method: 'feed',
link: 'http://discussiontopic.comyr.com/spider/',
name: 'Test',
caption: 'Test Caption',
description: 'This is a test.'
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With