1

I have created a facebook app and need to post on all users FB WAll, who have authorized app to post on there behalf.

i.e, A new event organized somewhere, So through App, admin can post on every App Users FB Wall about the event.

I was using Graph API, however its not working.

Any Pointers/ Guidance will be highly appreciated.

Thanks

Ashok Gupta
  • 2,247
  • 5
  • 28
  • 34

2 Answers2

0

You have to do an api call with parameters to post on the users wall.

Edit.:

Here is the below linked example, with some explanation:

<?php
 $attachment = array(
'message' => 'this is my message',
'name' => 'This is my demo Facebook application!',
'caption' => "Caption of the Post",
'link' => 'http://mylink.com',
'description' => 'this is a description',
'picture' => 'http://mysite.com/pic.gif'
);
?>
$result = $facebook->api('/me/feed/', 'post', $attachment);

The $attachment array contains the parameters of the wall post and the $facebook->api('/me/feed/','post',$attachment); make the call and returns the result into $result.

Here you can find the source: How do you post to the wall on a facebook page (not profile)

Community
  • 1
  • 1
Cerbi
  • 41
  • 4
  • Please provide sample code with your explanation of how it works, instead of links to examples. You could post this in a comment, not an answer. – John Willemse Mar 05 '13 at 11:14
0

Publishing to user's wall in JS SDK:

var body = 'Status Test';
FB.api('/me/feed', 'post', { message: body }, function(response) {
   if (!response || response.error) {
       alert('Error occured');
   } else {
       alert('Post ID: ' + response.id);
   }
});

[EDIT]
In Php

 $ret_obj = $facebook->api('/me/feed', 'POST',
                array(                      
                  'message' => 'Posting with the PHP SDK!'
             ));
ThePCWizard
  • 3,338
  • 2
  • 21
  • 32