-1

My Facebook App using Graph API posting a post to friend wall of the user. But the post on friend wall shows "post from my app". I have to show the user name instead of my app name.

My Code is

    $Facebook = new FB();
    $result = $Facebook->api('/1033301390979876/feed', 'POST', array(
        'access_token' => $access_token,
        'message' => 'Hey I m Using Ylla... Will U???',
        // 'from' => array('name' => 'Pandi Selvam' , 'id' => '1033371111983124' ),
        //'to' => array('name' => 'Mahesh Ramasamy' , 'id' => '1033301390979876' )

    ));

Here the to and from parameter is not working. I can post without to and from parameter.

1 Answers1

0

The only way to post to a friends wall with the Facebook API is with a FB.ui dialog, using the JavaScript SDK:

You can use the parameter "to", to add the ID of the friend. Of course this cannot be done in the background, the user has to authorize each post. Which is good, because posting on the friends wall is considered spam in most cases, that´s why it is not allowed that easily anymore.

Good thing about the FB.ui dialog: You are not allowed to prefill the message parameter (anymore), which has to be 100% user generated anyway while using the PHP SDK.

Edit: The "to" parameter does not exist anymore, and the new Share-Dialog replaces the Feed-Dialog.

andyrandy
  • 72,880
  • 8
  • 113
  • 130