2012-04-20 14 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); 
関連する問題