【问题标题】:Posting Picture on Event Page在活动页面上发布图片
【发布时间】:2012-03-15 10:57:23
【问题描述】:

我在 Facebook 上的活动墙上发布图片时遇到问题。 正在发帖

我当前的代码是:

$post_array = array(
    "access_token" => $facebook->getAccessToken(),
    'source' => "@" . realpath("image.png"),
    'message' => 'Some Message'
);
$post_id = $facebook->api("/".$event_id['id']."/feed", "POST", $post_array);

一切正常,除了图像:它不会显示。

有什么帮助吗?

【问题讨论】:

    标签: php facebook facebook-wall facebook-events


    【解决方案1】:

    如果是事件,请尝试:

    //Setup the Facebook object for file upload $facebook = new Facebook(array( 'appId' => 'your_app_id_here', 'secret' => 'your_secret_here', 'cookie' => true, 'fileUpload' => true ));

    然后:

    $file = "image.png"; //The event information array (timestamps are "Facebook time"...) $event_info = array( "access_token' => 'your access token", "name" => "Event Title", "start_time" => 1290790800, "end_time" => 1290799800, "location" => "Your Location", "description" => "Event Description" ); $event_info[basename($file)] = '@' . realpath($file); $result = $facebook->api('me/events','post',$event_info);

    希望对你有帮助

    【讨论】:

    • 您好,感谢您的帮助。但我正在寻找一种可能性,将图片发布到活动的墙上,而不是作为活动中的图片(效果很好)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多