1
創建Facebook應用程序Facebook cURL發帖爲我?
使用cURL從應用程序發佈消息,但它似乎是從我發佈?如何我可以從應用程序發佈,這是我的捲曲
$attachment = array(
'access_token' => $token,
'message' => '$message',
'name' => '$name',
'link' => '$link',
'description' => '$description',
'picture'=> '$picture',
'actions' => json_encode(array('name' => '$name2','link' => '$link2'))
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/'.$pId.'/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);
員額的作品,但它就像我的貼吧出現,而不是應用程序,建議?
你是怎麼得到'$ token'的?什麼是'$ pId'? – grossvogel
令牌我已經保存在一個分貝和pId是Facebook的人員ID – Lagoo87
而且你保存的令牌是爲特定用戶,我想?我並不感到驚訝,這是代表用戶發佈給用戶的Feed,但我不知道如何(或者是否有可能)發佈爲應用。 – grossvogel