0

我正在努力使用 Facebook PHP API。

我想在我的 Facebook 墙上上传一张照片。它运作良好。但是当我添加带有值和朋友的隐私字段时,它不起作用。我真的很想覆盖应用程序隐私设置。

我该如何解决?谢谢。

    $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());
    }   
4

0 回答 0