开发者

Facebook wall post

I use the below code to post on my friends wall.

$facebook->api('/'.$item.'/feed?'.$token,'post',$attachment);

It works but the post on his wall sho开发者_StackOverflow社区ws his name and photo.

How can I show MY PHOTO and MY NAME in the post????

This is how I generate the token:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/oauth/access_token?client_id='.APP_ID.'&client_secret='.APP_SECRET.'&redirect_uri=http://www.facebook.com/pages/Cosmetics/167231286678063?sk=app_233227910028874&grant_type=client_credentials');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);

$token = curl_exec($ch);


You should set authentications token to the one generated using your login details.

you have to set an access token before you can evoke api eg: $facebook->setAccessToken($token); this token is created when user logs in to you app. This user will be the author of all posts made by api.


maybe you forgot access_token= ?

$facebook->api('/'.$item.'/feed?access_token='.$token,'post',$attachment);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜