2012-04-20 3 views
2
$profile_id = $userInfo['id']; 
      $picLocal = "https://xxxxxxxxxx/logo.jpg"; 
       $attachment = array('access_token' => $decodedSignedRequest['oauth_token'],'message' => $userInfo['name'].' is in the draw to win a Free wine for a year', 
      'name' => "Oliver's taringa", 
      'link' => $fbconfig['appPageUrl'], 
      'description' => 'Oliver\'s Taranga in McLaren Vale is home to the ultra-premium HJ Reserve Shiraz and has supplied grapes for the illustrious Penfolds Grange, arguably the pinnacle of achievement for Shiraz growers in Australia. So join their community to go in the draw to win a years worth of amazing wine!', 
      'picture' => $picLocal 
       ); 
       if(!($sendMessage = $facebook->api('/'.$profile_id.'/feed/','post',$attachment))){ 
       $errors= error_get_last(); 
       echo "Facebook publish error: ".$errors['type']; 
       echo "<br />\n".$errors['message']; 
       } 
      } 

이 코드는 모든 응용 프로그램에서 작동합니다. 그러나 지난 3 일부터 나는 메시지 등을보고, 우리는 뉴스에서 볼 수없는 그림 만 본다.PHP는 뉴스 작업 중이지만 그림은 업로드되지 않습니다.

http://i.stack.imgur.com/n06Jj.jpg

+0

나는 똑같은 문제를 겪고 있습니다. 해결책을 게시하는 경우에 대비하여 여기에서 계속 지켜 볼 것입니다 ... – FidoBoy

답변

0

다음 코드는 잘 나를 위해 노력하고 있습니다.

$data = array(
      "link" => $link, 
      "access_token" => $user_access_token, 
      "picture" => $image, 
      "name"=> $title, 
      "description"=> $description 
    ); 


$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, "https://graph.facebook.com/".$userId."/feed"); 
curl_setopt($ch, CURLOPT_HEADER, false); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
$op = curl_exec($ch); 
if (!$op) { 
    echo "Curl Error : ".curl_error($ch); 
    curl_close($ch); 
    exit; 
} 

curl_close($ch); 
$res = get_object_vars(json_decode((string)$op)); 
print_r($res); 
관련 문제