Publicar en la pared de la página con PHP SDK

I need my application to publish a post on my Wall page automatically and for that use PHP-SDK, but the publication does not appear. Until the notification that the publication occurred, but it does not appear in the Wall page. In the same script, if I change the page_id by "me" the publication is made in the wall of my profile perfectly.

Ver código:

   $fb_page_id  = 'xxxxxxxxxx';
   $fb_app_id  = 'xxxxxxxxxxxxxxxxxxxx';
   $fb_secret  = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
   $fb_app_url  = 'https://apps.facebook.com/application/';
   $fb_app_baseUrl ="http://www.mysite.com/app/application/";


$msg =  array(
    'message' => 'date: ' . date('Y-m-d') . ' time: ' . date('H:i')
);

//construct the message/post by posted data

$msg['message'] = 'Test';
$msg['link'] = $link;
$msg['picture'] = "http://www.mysite.com/app/facebook/icone_75_75.jpg";
$msg['name'] = $titulo;
$msg['caption'] = '';
$msg['description'] = $texto;
$msg['actions'] = array( array('name' => 'test', 'link' => 'http://www.mysite.com'));


    //Create facebook application instance.
    $facebook = new Facebook(array(
      'appId'  => $fb_app_id,
      'secret' => $fb_secret
    ));


    try {
        $facebook->api('/'.$fb_page_id.'/feed', 'POST', $msg);

    } catch (FacebookApiException $e) {
        print_r($e);
    }

Gracias.

Now I created a database for storing received tokens. I used the token to post, but did not work!

preguntado el 01 de febrero de 12 a las 14:02

By your wall page do you mean a facebook page as oppossed to your profile? I'm guessing you do as later you refer to changing the id to "me". is $fb_page_id definitely set correctly? And od you want to post as "you" or as the page? The later requires the manage_pages permission developers.facebook.com/docs/reference/api/page -

In summary the application should read a feed (XML) and publish that content on my page (not profile). I wish that the publication be made as the page and not mine. The $ fb_page_id is correct. The strange thing is that on my page appears notifying that there was publication. Then I return the post_id (140124419346040_348110541880759), but when I check via graph.facebook.com/140124419346040_348110541880759 it returns false. Finally, the application to be installed, asks permission to manage my pages. I need to provide some token somewhere in the code? -

Now I created a database for storing received tokens. I used the token to post, but did not work! -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.