2012-03-02 4 views
0

그래프 API로 소유 한 페이지 대신 Facebook에서 이벤트를 작성하려고합니다./페이스 북 이벤트를 rGraph API로 페이지로 작성

https://graph.facebook.com/ {페이지 ID}에 namestart_time을 (다른 것들은 선택 사항) 게시 이벤트

적절한 premissions와

(create_event, manage_pages)

: 는 FB 문서에서 나는이 다음과 같이 이루어집니다 읽기

그래프 API 탐색기에서이 주위에 놀고 이벤트를 만들지 만 페이지보다는 내 자신의 프로필에서 수행됩니다.

내 프로필이 아닌 페이지에서 이벤트를 만들 수 있습니까? 그것이 내가 이것에 대해 allready 많은 논의가 여기에있다 알아 내 프로필 ID

PPS되지 않도록

PS는 내가 두 번 페이지 ID를 확인,하지만 난 내 질문에 대한 간단한 답변을 찾을 수 couldnt는 unfortunatley.

답변

0

그래서 나는 이것을 알아 냈습니다. 페이지 액세스 토큰으로 게시해야했습니다. heres the code

$page_info = $this->fb->api('/' . $page_id . '?fields=access_token'); 
if (!empty($page_info['access_token'])) { 

$path = realpath(APPPATH . '../path/to/img'); 
$args = array(
    'access_token' => $page_info['access_token'], 
    'start_time' => $start_time, 
    'description' => $description 
    'name' => $name, 
    'location' => $loaction 
); 
$img = 'img.jpg'; 
if ($upload) {// if picture is needed 
    $args['@' . $img] = '@' . $path . '/' . $img; 

    $this->fb->setFileUploadSupport(true); 
} 

$res = $this->fb->api("/" . $this->input->post('fb_event'), "post", $args); // should give back event id   
} 
+0

게시자가 게시 한 코드가 충분한 통찰력을주지 못하기 때문에 실제로 필요한 사람에게는 도움이되지 않습니다. –

관련 문제