我正在努力使用Facebook PHP API。
我想在Facebook墙上上传照片。它运作良好。 但是当我添加有价值的朋友和朋友时,它不起作用。我真的想要覆盖App Privacy Setting。
我该如何解决?感谢。
$arguments = array('message' => 'post message',
'source' => '@' . realpath($tmp_file_pwd),
'privacy'=>array('value' => 'EVERYONE','friends' => 'EVERYONE'));
$this->facebook->setFileUploadSupport(true);
try{
$result = $this->facebook->api('/me/photos', 'post', $args);
return $result;
} catch(FacebookApiException $e) {
// If the user is logged out, you can have a
// user ID even though the access token is invalid.
// In this case, we'll get an exception, so we'll
// just ask the user to login again here.
//$login_url = $facebook -> getLoginUrl();
//echo 'Please <a href="' . $login_url . '">login.</a>';
error_log($e -> getType());
error_log($e -> getMessage());
}