0

誰でも私の問題に光を当てることができますか?

<?php

$config = array();
$config['appId'] =  "foo";
$config['secret'] = "bar";
$config['cookie'] = true;
$config['fileUpload'] = true;

$facebook = new Facebook($config);

$eventParams = array(
    "privacy_type"  => $this->request->data['Event']['privacy'],
    "name"          => $this->request->data['Event']['event'],
    "description"   => $this->request->data['Event']['details'],
    "start_time"    => $this->request->data['Event']['when'],
    "country"       => "NZ"
);

//around 300x300 pixels
//I have set the permissions to Everyone
$imgpath = "C:\\Yes\\Windows\\Path\\Photo_for_the_event_app.jpg"; 
$eventParams["@file.jpg"] = "@".$imgpath;

$fbEvent = $facebook->api("me/events", "POST", $eventParams);

var_dump($fbEvent); //I get the event id

ユーザーが自分に代わってアプリに投稿することを許可するように求められたときに、これも「スコープ」に含まれています。user_about_me,email,publish_stream,create_event,photo_upload

これは機能します。指定したすべての詳細でイベントを作成します。イベント画像は除きます。

私の問題に関連する Stackoverflow の投稿のほとんどにアクセスしましたが、それらのすべてが機能していません。(例: https://stackoverflow.com/a/4245260/66767 )

また、エラーは発生しません。

何か案は?

ありがとう!

4

1 に答える 1

0

はい、Facebookにバグがあるという考えです。イベントの写真にも問題があります。トラッカーのトピックであり、これは stackOverflowに関する私の投稿です

ところで、イベントを作成した後にこのコードを試すことができます->

public function uploadFacebookEventPicture($fullPath, $eventId) {
    $mainImage = '@' . $fullPath;   
    $imgData = array(
        'picture' => $mainImage
    );
    try {
        $data = $this->facebook->api('/'.$eventId, 'post', $imgData);
        return $data;
    } catch (FacebookApiException $e) {
        error_log('Failed to attach picture to event. Exception: ' . $e->getMessage());
    }       
    return null;
} 

Facebookの問題が発見されて以来、私にとっては機能しなくなりました。

于 2012-08-29T14:57:25.290 に答える