Facebook APIが機能していません..行にコメントすると
$naitik = $facebook->api('/naitik')
;
エラーをスローする
「パラメーター app_id が必要です」
そうしないと
"Fatal error: Uncaught OAuthException: Invalid OAuth access token signature. thrown in /mounted-storage/home122a/sub004/sc44038-VQQX/psychegames.com/test/src/base_facebook.php on line 1271"
私のPHPコードは
<?php
require '../src/facebook.php';
// Create our Application instance (replace this with your appId and secret).
$facebook = new Facebook(array(
$appid = 'MYAPPID',
$appsecret = 'MYAPPSECRETID',
$pageId = 'MYPAGEID'
));
$access_token = $facebook->getAccessToken();
// Get User ID
$user = $facebook->getUser();
// We may or may not have this data based on whether the user is logged in.
//
// If we have a $user id here, it means we know the user is logged into
// Facebook, but we don't know if the access token is valid. An access
// token is invalid if the user logged out of Facebook.
if ($user) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
// Login or logout url will be needed depending on current user state.
if ($user) {
$logoutUrl = $facebook->getLogoutUrl();
} else {
$loginUrl = $facebook->getLoginUrl(array(
'req_perms' => 'publish_stream,read_friendlists'
));
}
// This call will always work since we are fetching public data.
$naitik = $facebook->api('/naitik');
?>