I want to post something from within my application to the logged in users' facebook wall. I have the following code which will take the user to the facebook login page if he is not login and then back to the "canvas page url" in my application which i have set in the application settings on facebook.
I have two problems here ::
- In fb:name tag, I do not get the name of the user when we return after doing login to the facebook.
- I get fb:name output on the page only if i comment the stream_publish api call, if I include it, then there is no message posted to the wall and I get a blank page with no output.
$facebook = new Facebook('apikey', 'apisecret');
$fb_user = $facebook->require_login();
$facebook->api_client->stream_publish('Hi, what are you doing right now?');
Hello <fb:name uid='<?php echo $fb_user; ?>' useyou='false' possessive='true' />! Welcome to my first application!
echo "<pre>Debug:" . print_r($facebook,true) . "</pre>";