0
我的老方法來設置年齡限制就像是如何使用新的PHP庫設置年齡限制?
$userID = $facebook->require_login($required_permissions = 'email, publish_stream,offline_access');
$info = array('age' => '18+');
$success = $facebook->api_client->admin_setRestrictionInfo($info);
而即將過時的舊方法,我不得不重寫代碼。我想盡一切辦法,然後找到我應該調用API方法這種方式,
$accessToken=$facebook->getAccessToken();
echo "<BR>access_token is: ".$accessToken;
$result = $facebook->api(array(
'method' => 'admin.setRestrictionInfo',
'restriction_str' => json_encode(array('age' => '18+')),
"access_token" => $accessToken,
));
但是,它總是拋出下面的錯誤
access_token is: 112819402105453|9761b1a933b0277ff56453a6.1-1670893505|zJEVp2JXbHzRVSVXmJUgV-Fz13o
Fatal error: Uncaught Exception: 15: This method must be called with an app access_token. thrown in /usr/local/chroot/carrotbid/home/php/facebook_api/base_facebook.php on line 708
任何解決方案?謝謝你的幫助。