Link to home
Start Free TrialLog in
Avatar of puneetdudeja
puneetdudejaFlag for India

asked on

About facebook api stream publish call.

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.

Please help.
require_once '../../lib/Facebook/facebook.php';  
$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!
<?php
echo "<pre>Debug:" . print_r($facebook,true) . "</pre>";

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of mankowitz
mankowitz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial