0
I wonder if anyone has managed to implement facebook check-in in a php system.
<?php
header("Content-type: text/html; charset=UTF-8");
// datetimezone
date_default_timezone_set('America/Sao_Paulo');
// habilita erros do php
ini_set('display_errors', true);
// autoloader gerado pelo composer
require_once __DIR__ . "/vendor/autoload.php";
// APP Config
define('APP_ID', '');
define('APP_SECRET', '');
define('APP_VERSION', 'v2.8');
// instancia do facebook
$fb = new Facebook\Facebook([
'app_id' => APP_ID,
'app_secret' => APP_SECRET,
'default_graph_version' => APP_VERSION
]);
// access token
$accessToken = '';
try {
// dados para envio da publicacao no feed
$feed_data = array(
"message" => "LOJA!",
"place" => "140262660539",
);
$response = $fb->post('/me/feed', $feed_data, $accessToken);
$graphNode = $response->getGraphNode();
echo 'ID da Postagem: ' . $graphNode['id'];
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
Welcome to OS Max, are you having any specific mistakes with the SDK? Edit the question by specifically saying where is the problem that it becomes easier to help.
– Ricardo Moraleida
my problem is that I can’t checkin does not show the location, error #200 appears from the facebook api. what is missing?
– Max Vanderbil
I made an implementation first log with facebook and then is forwarded to the page fb-checkin.php.... further presents the following error: Facebook SDK returned an error: You must provide an access token.
– Max Vanderbil