Florian Shena
Florian Shena

Reputation: 1434

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 shows 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);

Upvotes: 0

Views: 378

Answers (2)

Ivan
Ivan

Reputation: 3645

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.

Upvotes: 1

genesis
genesis

Reputation: 50966

maybe you forgot access_token= ?

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

Upvotes: 0

Related Questions