ecco il codice che ho usato: e l'errore che mi da
<?php
require 'src/facebook.php';
$facebook = new Facebook(array(
'appId' => '***********',
'secret' => *************************',
));
if ($user) {
$logoutUrl = $facebook->getLogoutUrl();
} else {
$params = array(
'scope' => 'publish_stream',
'redirect_uri' => 'http://www.miosito.com/fb/index.php'
);
$loginUrl = $facebook->getLoginUrl($params);
}
?>
<!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>Scrivere sulla bacheca di Facebook by devtips.zapto.org</title>
</head>
<body>
<?php if ($user): ?>
Logout
<?php else: ?>
<div>
login:
Login
</div>
<?php endif ?>
UNA VOLTA CONNESSO E DATO I PERMESSI CI RITROVEREMO IL NUOVO POST
<?php
$facebook->api(
'/me/feed/',
'post',
array('access_token' => $facebook->getAccessToken(), 'message' => 'prova')
);
?>
ERRORE:
Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. thrown in....