2012-04-24 77 views
0

在我的應用程序中,我在牆上張貼圖像,它工作正常,但現在我的要求是使用消息打印我的應用程序的URL,用戶點擊鏈接,他被重定向到我的應用程序。在用戶牆上發佈圖像,然後是應用程序消息,然後是應用程序URL

+0

太好了!你需要從我們那裏得到什麼? – zerkms 2012-04-24 08:36:15

+0

您可以將消息應用到圖像,只需將消息添加到使用您的Facebook API的數組。 – JonathanRomer 2012-04-24 08:40:27

回答

0

你可以用捲曲的方法,現在用這個和它工作正常

$attachment = array(
          'access_token' => "accesstoken", 
          'caption' => "Hey -- this is caption", 
          'description' => "Your Desc", 
          'link' => "http://www.example.com/", 
          'picture'=> "path/image.png" 
         ); 

         $ch = curl_init(); 
         curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/XXXXXX/feed'); 
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); 
         curl_setopt($ch, CURLOPT_POST, true); 
         curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment); 
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //to suppress the curl output 
         $result = curl_exec($ch); 
         curl_close ($ch); 
相關問題