0

如何使用 facebook 应用程序创建 facebook 事件?此外,我想为此目的使用graph api,请帮助我...

$access_token = 'app_access_token';
$url = "https://graph.facebook.com/app_id/events";
$postdata = "access_token=$access_token&name=$name&start_time=$start_time&end_time=$end_time&description=$description&privacy=$privacy&location=$location&picture=$picture_source";             
$event_code = curl_sending_newsfeed_facebook($url, $postdata);

我已经完成了事件的创建,但没有显示事件的图片(我的意思是图片代表事件的面貌)

4

1 回答 1

1

尝试做这样的事情,

$fb = new Facebook(array(
    'appId' => YOUR_APP_ID,
    'secret' => YOUR_APP_SECRET,
    'cookie' => false,
    'fileUpload' => true
));
$imageFile = realpath('/path/to/your/example.jpg');
$eventInfo = array(
    'name' => 'some title',
    'start_time' => time()+32400,
    'description' => 'some description',
    basename($file) => '@'.$imageFile    
);
$result = $fb->api(
    '/'.$app_id.'/events',
    'post',
    $eventInfo
);
echo 'Created event #'.$result['id'];
于 2012-09-28T11:48:55.140 回答