2012-04-24 23 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); 
相关问题