0

在我的应用程序中,我在墙上发布图像,它工作正常,但现在我的要求是打印我的应用程序的 URL 和一条消息并拥有它,以便当用户单击链接时,他被重定向到我的应用程序。

4

1 回答 1

0

您可以使用 curl 方法,我正在使用它并且效果很好

$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);
于 2012-04-24T08:38:09.243 回答