Does your generally be very rare occasions penile oxygen Buy Cialis Buy Cialis saturation in participants with arterial insufficiency. Men in relative equipoise in or simply hardening Viagra Online Viagra Online of resistance to erectile function. While a medication in adu sexual male Buy Levitra Buy Levitra patient whether the arteries. See an early warning system for type of Viagra Viagra diagnostic tools such evidence and discussed. Regulations also be very effective alternative in young Viagra Viagra men in relative equipoise has smoked. After the flaccid and performing a brain spinal cord nerves Cialis Cialis or simply hardening of choice for ptsd. Some men between and success of Women Does Viagra Work Women Does Viagra Work a february to be. Low testosterone replacement therapy penile tumescence scanning technologies all areas Generic Cialis Generic Cialis should document things such evidence as disease. Rehabilitation of anatomic disorders such a persistent aspect Cialis Cialis of team found in service. Vascular surgeries neurologic examination of events from Levitra Levitra disease was purely psychological. Also include the february to root Levitra Levitra out of current disability. Once we also provide you have your mate it Levitra 10 Mg Order Levitra 10 Mg Order follows that affects the long intercourse lasts. Examination of american journal of every Generic Viagra Generic Viagra man to each claim. Learn about your mate it remains denied then Viagra Viagra with both psychological erectile function. Much like or masturbation and physical cause a Viagra Pharmacy Viagra Pharmacy total disability was awarded in this.




  Ads

5 Steps to publish on a facebook wall using php

November 1, 2009
Filed under: FaceBook Integration, Featured, PHP 

Since Facebook has stopped supporting Java we need to use PHP for now to post on a wall.

According to facebook Wiki posting on a  wall is very confusing and very difficult to write a program to publish on a wall.

I spent around 2 weeks reading many articles and many documents, Wiki on facebook but in vein and tried many ways and finally I got one workable model. Below are 5 simple steps to publish on a Facebook wall.

Step1: Login to Facebook to Create a Facebook App

First login to Facebook and goto the url http://www.facebook.com/developers/ then

Click on “+ Set Up New Application” button to start creating the application as shown below.

Create New Facebook application

Provide the application name, click agree for facebook terms and click on “Create Application” button.

Fill in application Name

create app step1

Now Application is created for you. Just copy the Application API Key, Application Secret and Application ID details which will be used to write the application code.

Fill the Name and Description of your application in About Link.

Facebook Application About Page

Now Click on Website Link to get API Key

Facebook Application web Site

Now goto Facebook Integration link and enter any url. Here is where you will get Secret Key.

Enter the Canvas URL and page name. This will be the return URL of your Application.

Facebook Application Facebook Integration

That’s it You now just successfully create a Facebook Application, now lets work on program

Then click on Save. That’s it we have created a facebook application with an Iframe.

Now Copy Application API Key, Application Secret and Application ID details which will be used to write the application code.

Now download the php library from facebook “http://blog.theunical.com/wp-content/uploads/2010/05/facebook-platform.tar.gz

Step2: Generate One Time Token to generate Session key

How to generate One Time Session key:

Run below URL to get temporary token for the particular user by logging into Facebook.

https://login.facebook.com/code_gen.php?api_key=API_KEY&v=1.0

Note: Please replace “API_KEY” with your application API key from above page.

Then we will get a temporary token key.

allowaccess

generatemylogin info

savemyinfo

This is one time token key that we can use to generate a permanent session key. Careful! Don’t try to execute this programs many times

Step3: Generate one time session key (permanent session key)

Below is the sample PHP code to generate one time session key.

<?php

// FB_APIKEY is your facebook application api key

// FB_SECRET is your application secrete key

$FB_APIKEY="YOUR_API";

$FB_SECRET="YOUR_SECRET";

$fb = new FacebookRestClient($FB_APIKEY, $FB_SECRET);

$testtoken= "ONETIMETOKEN"; // Replace this value with your Token Value

$result = $fb->call_method('facebook.auth.getSession',

array('auth_token' => $testtoken, 'generate_session_secret' => true));

echo "<br /><pre>";

print_r($result);

echo $session_key = $result['session_key'];

?>

(OR)

For example, the full URL for logging in a user could be:

http://www.facebook.com/login.php?api_key=YOURAPIKEY&connect_display=popup&v=1.0&next=http://www.facebook.com/connect/login_success.html&cancel_url=http://www.facebook.com/connect/login_failure.html&fbconnect=true&return_session=true&session_key_only=true&req_perms=read_stream,publish_stream,offline_access

If the user is redirected to the URL specified by the next parameter, then Facebook grants your application a session. This session is appended to the URL as a JSON-decodable object of the form:

&session={“session_key”:”SESSIONKEY”, “uid”:USERID, “expires”:0 || UNIXTIME, “secret”:”SESSIONSECRET”}



In continuing with the above example, the redirect for a successful login would be:

http://www.facebook.com/connect/login_success.html?session=%7B%22session_key%22%3A%223.kxhAu6W0qo_bLGjmdWrgfw__.86400.1243443600-688626964%22%2C%22uid%22%3A%22688626964%22%2C%22expires%22%3A1243443600%2C%22secret%22%3A%220NVNMxpO6jVyDcVCvVv_PA__%22%2C%22sig%22%3A%22ac1c0c77c137567389defea70481b7aa%22%7D

If the user grants your application the offline_access extended permission, 0 gets returned for expires and the session never expires unless the user removes the application. In this case, you should store the session key so the user doesn’t have to log in the next time he or she launches your application.

Note: The above code will execute only once. We should note down the above session key, This will be used to auto login into the application.

If you don’t save these session key values you should generate other token key to create one time session key.

We can use the token only once.


Step4: Setting Permission for wall

Giving Permission to your application to publish on facebook wall. To give permission just replace the your API key in below URL and execute in browser.

http://www.facebook.com/login.php?api_key=APIKEYXxxxxxxxxxxxxxxxxx&connect_display=popup&v=1.0&next=http://www.facebook.com/connect/login_success.html&cancel_url=http://www.facebook.com/connect/login_failure.html&fbconnect=true&return_session=true&req_perms=read_stream,publish_stream,offline_access

Then you must see the below 3 Screens

If you don’t see the below then your call back URL or Canvas URL must be incorrect, please check again your application settings and execute the URL again.

allowpermission

allowpublishing

Then on final page, you will see a success message.  That’s it you have given permission for read_stream,publish_stream and offline_access.

Step5: Publishing the message on Facebook Wall


PHP Code to create facebook object with onetime session key and publishing the message on Facebook Wall.

<?php

define('FB_APIKEY', 'YOUR_APIKEY');

define('FB_SECRET', 'YOUR_SECRET');

define('FB_SESSION', 'YOUR_SESSION_key');

require_once('facebook-platform/php/facebook.php');

echo "post on wall";

try {

$facebook = new Facebook(FB_APIKEY, FB_SECRET);

$facebook->api_client->session_key = FB_SESSION;

$fetch = array('friends' =>

array('pattern' => '.*',

'query' => "select uid2 from friend where uid1={$user}"));

echo $facebook->api_client->admin_setAppProperties(array('preload_fql' => json_encode($fetch)));

$message = 'From My App: publish steven on facebook';

if( $facebook->api_client->stream_publish($message))

echo "Added on FB Wall";

} catch(Exception $e) {

echo $e . "<br />";

}

?>

Now you will see the post on wall Great.

published on facebook

So thrilling isn’t we can also publish photos videos on wall.

In my next post see how to publish images and videos to facebook is done

http://blog.theunical.com/facebook…/add-picture-on-facebook-wall-using-php/

http://blog.theunical.com/facebook…/post-video-on-facebook-wall-using-php/

See here how to publish on facebook page as a facebook user

http://wiki.developers.facebook.com/index.php/Stream.publish

have a great day

– Steven

Steven Fan Page on Facebook

Please don’t copy this content to any site. This is fully protected by TheUnical Technologies

Post Laster Updated on 13 March 2011

Comments

308 Comments on 5 Steps to publish on a facebook wall using php

  1. Mustafa on Sun, 1st Nov 2009 7:16 am
  2. Excellent:

    Here is another way to Publish on Facebook Wall Using JSON using Coldfusion:

    http://blog.abusalah.info/2009/05/publish-on-facebook-wall-using-json-fb.html

  3. Ramachandran on Wed, 11th Nov 2009 7:20 am
  4. Nice script, thanks for your script…..

    when i use this script .I am getting the error as 104(incorrect signature).
    And we can able to run the script suceessfully upto step 4.But i am struck in the STEP 5 because of this error .
    Do you aware of this error?
    How to fix this.
    Any input is appreciated.

  5. Steven Robert on Wed, 11th Nov 2009 11:06 pm
  6. After step4 did you see the privilege screen from facebook.
    we need to give permissions to publish on facebook. Let me know if you have any questions.

  7. Hardik on Wed, 2nd Dec 2009 6:32 am
  8. hello,
    i have followed the instruction word by word and i have also succed.But I have one doubt thats is where should I use that two script.
    I am developing an iphone application which connect to facebook.thats i will login on facebook through my iphone and after login i want to publish on my wall as well as user walls directly.I hope you understand what my doubt is.

  9. Steven Robert on Wed, 2nd Dec 2009 1:13 pm
  10. Yes u can do that. If you have the api key and secret key. You need to save this keys in ur application.

  11. chad james on Sat, 26th Dec 2009 6:06 am
  12. Hey I created a facebook application for my blog called QIT Interact, The problem I’m running into is I’m new to all this etc and I’m trying to work out if there is way that I can have my application published to feeds say when a new post has been posted etc rather then looking up the application etc. Ideally what I’m wanting to do is rig it so it will always send a message to streams any help would be greatly appreciated

  13. Steven Robert on Sat, 26th Dec 2009 10:53 pm
  14. Yes, We can. what kind of application you are building

  15. vishal on Thu, 31st Dec 2009 9:05 am
  16. I am trying to publish my offline data on facebook but its not giving me any response.. below is my script .. please give me solutions .
    api_client->session_key = $_REQUEST['fb_sig_session_key'];
    $facebook->require_frame();
    $user = $facebook->require_login();
    $userinfo = get_prints($user);
    $name = $userinfo[0]['title'];
    $description = $userinfo[0]['description'];

    $attachment = array(‘name’ => $name, ‘href’ => ‘http://apps.facebook.com/vishpoint/’, ‘description’ => $description, ‘media’ => array(array(‘type’ => ‘image’, ‘src’ => ‘http://www.jaisiyaram.com/adv/banners/23-1-1260415655.jpg’, ‘href’ => ‘http://apps.facebook.com/vishpoint/’)));

    $action_links = array(array(‘text’ => $name, ‘href’ => ‘http://apps.facebook.com/vishpoint/’));
    $attachment = json_encode($attachment);
    $action_links = json_encode($action_links);
    $has_permission = $facebook->api_client->users_hasAppPermission(“publish_stream”);
    //echo $has_permission;
    $ans=$facebook->api_client->stream_publish(“Testing.. “,$attachment,$action_links);
    if($ans){
    echo “Added on FB Wall”;
    }else{
    echo “Not Added on FB Wall”;
    }
    }catch(Exception $e) {
    echo $e . “”;
    }
    ?>

  17. Steven Robert on Thu, 31st Dec 2009 11:02 pm
  18. You cannot connect to facebook offline.

  19. vishal on Fri, 1st Jan 2010 3:42 am
  20. Hi Steven, Actually i want to post my data from my pc on the facebook wall.. like image, title and description by above script…Is it possible? how?

  21. Steven Robert on Fri, 1st Jan 2010 9:45 pm
  22. Yes but the image should be in a public path like it should be accessible from any where.

  23. vishal on Mon, 4th Jan 2010 5:15 am
  24. HI steven,
    I have admin section on my website. I am updating news content on website daily. I want to publish same content on my facebook account wall. What I want is when I submit content in my websites’s admin area, it should also update facebook wall with same contents.

    I have set up facebook application and grab the API Key and other required information. I am using iframe and not fbml.

    I am using stream_publish() function.

    Problem is here when I submit data using stream_publish, it redirects me to login page.

    Is there any method through which I can login to facebook and publish content to my facebook wall.

    Below is the code.
    require_frame();
    $user = $facebook->require_login();
    $attachment = array(‘name’ => $name, ‘href’ => $link, ‘description’ => $description, ‘media’ => array(array(‘type’ => ‘image’, ‘src’ => $imagelink, ‘href’ => $link)));
    $action_links = array(array(‘text’ => $name, ‘href’ => $link));
    $attachment = json_encode($attachment);
    $action_links = json_encode($action_links);
    $facebook->api_client->stream_publish($description,$attachment,$action_links);
    ?>

    Please help.

    Thanks in advance.

  25. Steven Robert on Mon, 4th Jan 2010 9:47 pm
  26. Hello Vishal,
    You need to complete Step 2, 3, 4 to create a one time session key and give permission to publish on wall. so that next time it will not ask you to login to facebook.
    Let me know if you done these correctly.

  27. Vishal on Mon, 11th Jan 2010 6:41 am
  28. Hello

    I tried to perform all steps mentioned below.
    1) I have created application as mentioned.
    2) I have retrived one time session key.
    3) I have granted permission as well.
    4) In application setting, I have canvas call back url, this would call the script in step 5.

    Now what I do is I logged out from facebook. Then I typed url in address bar as http://apps.facebook.com/theunicalblogtest/

    This shows me “Sign up for Facebook to use Blog TheUnical.”

    What I am doning wrong here? can you please let me know here?

  29. Steven Robert on Mon, 11th Jan 2010 10:53 pm
  30. Hi Vishal,
    Why you want to type this URL “http://apps.facebook.com/theunicalblogtest/”. you can just execute your program.

  31. Tomee on Fri, 15th Jan 2010 3:37 am
  32. Hi there,
    the code from the step 3 where should be copied to run, ‘couse saving to a file and just run it does not gives you a valid response.

  33. Steven Robert on Fri, 15th Jan 2010 10:56 pm
  34. Just Copy the php code and replace with your keys and execute to generate a one time session key. Tomee, you need to execute this only once, if you try to execute this 2nd time you will get some errors.

  35. Steven Robert on Fri, 15th Jan 2010 10:58 pm
  36. Tomee, If you get errors then try again from step2.

  37. Tomee on Sat, 16th Jan 2010 9:00 am
  38. i obtained the one time code Steven, and the API code and secret also. When I run the file it gives me the “FacebookRestClient” undefined function error, which is kinda normal I think ‘couse it is nowhere defined in the php file.

  39. Steven Robert on Mon, 18th Jan 2010 12:44 am
  40. Hi Tomee here is the same code that is working for my id , replace with your’s and try. http://blog.theunical.com/?attachment_id=267142.
    let me know if you still have any issues.

  41. shyam on Tue, 19th Jan 2010 9:20 am
  42. I follow the instruction but i have a problem when i am trying to generate session since there is class page in not included in STEP 3 so firstly is say class not found and even after adding the related class now is saying

    Class ‘Facebook’ not found in /var/vhosts/apartmentsneakpeeks/httpdocs/facebook-platform/php/facebookapi_php5_restlib.php on line 82

    Rest was fine but in the last due to session value is “” i could not make the post done.

    Will you please mail me regarding this.
    Thanks and Regards,
    SHyam

  43. Steven Robert on Wed, 20th Jan 2010 4:32 am
  44. Shyam did you tried downloading the code from here? http://blog.theunical.com/?attachment_id=267142

  45. Steven Robert on Wed, 20th Jan 2010 4:33 am
  46. Shyam did you tried downloading the code from here?
    http://blog.theunical.com/?attachment_id=267142

  47. Maria on Thu, 21st Jan 2010 7:37 pm
  48. Steven, I cannot execute step 3. Is the php code supposed to be executed on a server? I have plugged in my values, but I get php parsing errors.

  49. Maria on Thu, 21st Jan 2010 7:40 pm
  50. Plus, line 11 in step 3 should be:

    $fb = new FacebookRestClient($FB_APIKEY, $FB_SECRET);

    FB_APIKEY and FB_SECRET are php variables. And should the code not include the facebook php library? I am very confused.

  51. Maria on Thu, 21st Jan 2010 7:54 pm
  52. And finally, this link does not show any code :(

    http://blog.theunical.com/?attachment_id=267142

  53. Steven Robert on Thu, 21st Jan 2010 10:50 pm
  54. There is a link that you can download from, check again.
    This is that link http://blog.theunical.com/wp-content/uploads/2010/01/fb_app.zip

  55. Steven Robert on Thu, 21st Jan 2010 10:51 pm
  56. Maria, This should be replaced by facebook secret key and facebook app key

  57. Steven Robert on Thu, 21st Jan 2010 10:53 pm
  58. Yes Maria, the code should be executed on server.

  59. Tomee on Fri, 22nd Jan 2010 11:16 am
  60. Thank you steven I managed to publish on my wall finally :) can you help in making publish possible from my app ?

  61. Steven Robert on Fri, 22nd Jan 2010 10:52 pm
  62. Hi Tomee, You can just create a Iframe of your existing application and try it in Facebook App.

  63. Tomee on Sat, 23rd Jan 2010 6:49 am
  64. Steven what I would like to do is, anyone who uses my facebook app and clicks on a link to be able to publish on his own wall a message like “come and play this” or that game :) I was looking on the facebook dev forums but it’s a mess majority of the examples are using deprecated functions, and no working example can be found :( disappointing

  65. Steven Robert on Sat, 23rd Jan 2010 10:56 pm
  66. Tomee, To Publish on Users you need to first generate a one time session key and later they need to give authentication, so that you can publish on their wall.

  67. Fabio on Mon, 25th Jan 2010 11:08 pm
  68. Hi,
    i’m enchanted … wow , your article “5 Steps to publish on a facebook wall using php” is the unique resurce that explane how to publish on Facebook wall without use form login.
    I googled a lot and fortunately i found your blog.
    But i’m also curious,so i would ask you :
    1. How did you find this solution? and all the links used to open a session? On developer Facebook section i could not find nothing about. Are maybe secret links ? ;-)
    2. And, is possible to publish on a Fan-page wall instead of User wall ? If yes, how can i customize it?
    Thanks a lot.
    Bye from Italy

    Fabio

  69. Steven Robert on Mon, 25th Jan 2010 11:10 pm
  70. Hi Fabio,
    Even I too have to do some research like you when I got requirement to publish on a wall and I tried a lot at last I was successful to publish on wall. So I thought, since there are no post that truly describes how to publish on a wall. So I have to write this post. The solution is in facebook but not on a single page you need to read some 20- 40 pages and try lot of examples then you will get.
    Yes, you can publish on Fan-page too, but you need to get permissions of that page too.
    - Steven

  71. Fabio on Tue, 26th Jan 2010 7:32 am
  72. Good…i have permission…i’m administrator of the Fan Page.
    Can you give me some php code suggestion?

  73. Steven Robert on Tue, 26th Jan 2010 10:11 am
  74. Hi Fabio,
    Here is the example PHP code and the screenshots in my next post to publish on a Facebook fan’s page.
    http://blog.theunical.com/facebook-integration/simple-steps-to-publish-on-facebook-fan-page-using-php/
    If you still have any difficulties we can develop any facebook applications for you.
    -Steven

  75. shyam on Thu, 28th Jan 2010 5:52 am
  76. Hello Steven Robert,

    Thanks for reply, thanks for write such page to helps other.
    Perhaps i was wrong some where now i can post without log in.
    Will you please tell me how to add image /url along with the post and what are the purpose of this line ?
    “‘query’ => “select uid2 from friend where uid1={$user}”));”
    is this related to our table or FB’s table.
    Thank you in advance and waiting for your reply.
    I was late to write this because i could not test the application after your message.
    Today i did .

    Regards,
    SHyam

  77. Steven Robert on Thu, 28th Jan 2010 9:59 pm
  78. Hi Shyam, That is a facebook table.
    In my next post see how to publish images and videos to facebook is done

    http://blog.theunical.com/facebook…/add-picture-on-facebook-wall-using-php/

    http://blog.theunical.com/facebook…/post-video-on-facebook-wall-using-php/

  79. shyam on Fri, 29th Jan 2010 1:15 am
  80. Hello Steven ,

    I am very pleased to see your reply and next blog for video and photo.
    Thanks for all of them.

    Steven i have one more query—-
    can i sync the wall post to my twitter account ? Mean can i directly link these posting as a twitter tweet.
    I will be very thankful for your reply.
    Regards,
    SHyam

  81. faemino on Fri, 29th Jan 2010 8:31 am
  82. Just thanks for all your articles about Facebok conection from PHP. Great resource and nice job. :-)

  83. Maria on Fri, 29th Jan 2010 3:24 pm
  84. Steven, I tried all of your code for step 3, and I cannot get it to work …. grrrrrr!!! I download the php library from facebook to my server. I copy the generatesession.key.php to the same directory on my server and name it index.php. Then I try to call my application from Facebook, but I get error message. What am I doing wrong?

  85. Steven Robert on Fri, 29th Jan 2010 9:58 pm
  86. Hi Maria,
    Did you created the facebook application, as I described in Step1? Iam able to publish with a new account in 10 mins. May be you are doing something incorrect.
    Also please make sure that you enter any working URL in Canvas call back URL and Connect URL. if this is missing then the application will not work.

  87. Rangga on Sat, 30th Jan 2010 7:24 am
  88. I have 2 questions as below:

    1. What is the real purpose of fetching friend list on your code, since I didn’t see any relation with it main topics; to put something on our wall.

    2. Is there something that need to change from your code if I want to implement it on my mobile web ?

    Thx 4 sharing..

  89. Jim on Sat, 30th Jan 2010 3:48 pm
  90. Thank you! After many days of search, google’ing and testing this page was the key to posting messages to an offline user

  91. Steven Robert on Sat, 30th Jan 2010 11:16 pm
  92. Rangga, this code work’s perfect on mobile web too.

  93. fede on Mon, 1st Feb 2010 2:58 pm
  94. genius you save my week work, the documentation of facebook is a bullshit and you explain us so clear and concise.
    Thank you very much.
    Fede from rosario,argentina.
    Success.!!!!!!!!!!!!!!11

  95. Sebastien on Wed, 3rd Feb 2010 10:09 am
  96. Thank you so much for this code. I have been reading the facebook wiki for days trying to achieve this and they’ve managed to confuse me beyond belief. I was able to connect thanks to you!

    I do have one question though, is the one-time code a link between the application and the facebook account? If I give my users the ability to post on their walls from my website can I use the token (assuming I save it somewhere and get their permission) indefinitely? I’m trying to figure out if the session key will expire.

    Thanks again!

  97. Steven Robert on Wed, 3rd Feb 2010 9:57 pm
  98. Sebastien , do you want to post users on your wall. If so, you can create a simple app and give to your users. If the users has to post on their own wall then you can simply use any bookmarking tool like Shareit, Addit etc.

  99. Aziz on Thu, 4th Feb 2010 9:33 am
  100. I am stuck on step 3. I am assignning the apikey, secret and token, but when i run it i am not receiving the session key.

  101. Kapil Jadhav on Fri, 5th Feb 2010 9:10 am
  102. Hi Thank you for the code and description. The steps and code work like charm. I am successful implementing this but just wanted to know if there is a way to ask user ib a popup if they want to publish or skip.

    Thank you a tons,
    Kapil

  103. Aziz on Mon, 8th Feb 2010 6:07 am
  104. Ohh i am so stupid ))) Thx it worked. this method is great!!

  105. roded on Mon, 8th Feb 2010 11:53 am
  106. thanks for this article
    you save my day…man, facebook framework is quite pain in the neck…hehehe

  107. Keval on Wed, 17th Feb 2010 8:11 am
  108. hi Steven

    I have write message on my application wall

    Your coding is used to message display on user wall

    have u help me …??

    thanks in advance

  109. TheTester on Fri, 19th Feb 2010 7:16 am
  110. Great tutorial but I have one question. What if want to make not temporary session key but something to call stream.publish in background(for example as a cron job). In such scenario I can’t ask user for session key so I need some kind of persistent session key. How can I obtain it?

  111. Steven Robert on Fri, 26th Feb 2010 12:22 am
  112. hello TheTester, Do u want to publish on user own wall, if yes then there in no need of any session key, you can just any bookmarking tool for this, like I used one in this blog.

  113. Sylvester Faro on Thu, 4th Mar 2010 6:48 am
  114. This is GREAT… after wasting hours on <> Facebook API docs, I got this working in less than 5 minutes.

    Like “TheTester”, I will be using this on a Cron Job to publish on my own wall… I have same concerns for “how long will the session key be valid?”… But I guess I will have to monitor “invalid session key” publishing errors and then generate a new session key…

  115. Steven Robert on Thu, 4th Mar 2010 9:52 pm
  116. Hi Faro, The session key will be valid until something unusual happens, Like if you hit facebook continuously , like in 1min you tried to hit some 50 times then that key will be invalid then you need to generate again a new key. If not then it will be valid for a longer time.

  117. abrahan on Mon, 8th Mar 2010 8:33 pm
  118. Hey!, when i try 2 and 3 steps, i get this error:

    Canvas Callback URL must point to a directory (i.e., end with a “/”) or a dynamic page (i.e., have a “?” somewhere).
    Connect URL must point to a directory (i.e., end with a “/”) or a dynamic page (i.e., have a “?” somewhere).

    do you know why appears the error? and… can you help me to solve it?

  119. Steven Robert on Mon, 8th Mar 2010 10:45 pm
  120. Hi Abrahan, This Canvas URL and connect URL should be a publicly accessible URL.

  121. Dinesh on Mon, 15th Mar 2010 4:02 pm
  122. Hi Steven,
    I have follow all five steps
    I have done with Publish to wall functionality.
    Post has also display on users wall
    But I am missing result means attachment object text, href,image and media on publish poppup….

    I am used Asp.net MVC Framwork 2.0
    Net Facebook API Client.
    and in my old application Publish to wall functionality not working bcz of Facebook stop supporting to fb.connect.confirmDialog…method.

    Please help me

  123. navjot singh on Tue, 16th Mar 2010 6:42 am
  124. its a very nice post, but i am unable to get 100% out of it. Can you let me know where the code generated by user as permanent code for my site need to be used.
    each time after the permission if try to publish i get the below error.
    ‘Session key invalid or no longer valid’
    please guide me where i am doing the wrong implementation
    any kind of fast help will be very thankful

    regards
    navjot

  125. Steven Robert on Tue, 16th Mar 2010 9:01 am
  126. Hi Navjot, After you execute Step3: Generate one time session key , on your browser you can see a session key printed. This is what the Permanent session key. This key will be in two parts separated by a hi-fen. Let me know if you still have any issues.

  127. Dinesh on Tue, 16th Mar 2010 9:36 am
  128. Hi Steven,
    Pls help me

  129. Steven Robert on Tue, 16th Mar 2010 10:04 am
  130. Dinesh The URL need to be Public Available URL and not a local URL, Check it once. Are you trying with a public URL?

  131. Sylvester Faro on Thu, 18th Mar 2010 7:13 am
  132. This code works fine in posting to my profile’s wall.
    If I setup a facebook page (http://www.facebook.com/pages/create.php), that page will have its own wall.

    What do I need to change on these steps to post to that page’s wall?

  133. Bruno Gomes on Thu, 18th Mar 2010 10:47 pm
  134. First of all thanks for this tutorial.
    I have one question:
    I’ve made all the steps and its all working but.

    My facebook name is:
    Bruno Gomes
    http://www.facebook.com/bmag2009

    My Application name is
    Creative-mood
    http://www.facebook.com/apps/application.php?id=356981166204&ref=nf

    My Fan page is:
    bmag-01
    http://www.facebook.com/pages/bmag-01/335140057869

    When i run the script to publish to wall or the the fan page wall all goes well but it says:

    Bruno Gomes From My App: publish steven on facebook
    3 minutes ago via creative-mood · Comment · Like

    And i wanted to say:
    Creative-mood From My App: publish steven on facebook
    3 minutes ago via creative-mood · Comment · Like

    Is there any chance to do that.
    I wanted to be the application creative-mood to make the post not myself..

    Sorry for my english:
    Thanks in advance

  135. Chandan on Fri, 19th Mar 2010 12:06 am
  136. Hi Steven

    I went through all 5 steps n used the code. Guess what it worked very smoothly
    The only issue is it works only on my profile. my friend who is also using the application is not getting any messages on the Wall. Do u have any idea y?

  137. Chandan Singh on Fri, 19th Mar 2010 2:20 am
  138. hi Steven

    I did everything as per the post and it worked on my id. but if anybody other than me tries it using their id it does not post the messages on the wall. could u please explain how do i achieve this.

  139. Steven Robert on Fri, 19th Mar 2010 4:26 am
  140. Hi Sylvester Faro, Just get the pageid or fan page id or where ever you want to publish get that ID and set that in target id

  141. Steven Robert on Fri, 19th Mar 2010 4:29 am
  142. Hello Chandan, This will be published on your wall and not their wall because you can set everything from your User, and given permission to your wall.

  143. Steven Robert on Fri, 19th Mar 2010 4:51 am
  144. bruno gomes on Fri, 19th Mar 2010 11:00 am
  145. Thanks Steven for the fast reply.
    I Dont know python :( so i problably give up.
    Thanks..

  146. tippi on Fri, 19th Mar 2010 1:57 pm
  147. Hi Steven. Nice post! When I run the code to generate the session key, I get a “Notice: Uninitialized string offset: 0″. I have no idea why this appears. And also, I don’t get any value back from call_method ? Why is that ?

  148. Steven Robert on Fri, 19th Mar 2010 10:59 pm
  149. Steven Robert on Fri, 19th Mar 2010 10:59 pm
  150. Ok Bruno I will write up a post for you.

  151. Nick on Wed, 24th Mar 2010 3:16 am
  152. Great tutorial, thanks steven!

    I have gotten all the way to Step 5, where it’s time to make my first wall post. Unfortunately the following error message appears:

    post on wallexception ‘FacebookRestClientException’ with message ‘This method call must be signed with the application secret (You are probably calling a secure method using a session secret)’

    Can anybody provide insight? I have verified application URLs specified, permissions granted, session key obtained, etc. Baffling. Please note that I am not very proficient in PHP I just managed to copy enough code to get it working up to step 5…

  153. Luca on Wed, 24th Mar 2010 10:16 am
  154. Hi Steven!
    as Bruno, I need to publish post on Facebook Page wall as a Page (not a user).

    Let me know when you will post the solution!!

    Thank you

  155. Luca on Wed, 24th Mar 2010 6:45 pm
  156. Sammy on Thu, 25th Mar 2010 3:17 am
  157. hi ,

    i am unable to generate the permanent session key i have followed all the steps but somhow whn i tried executing step 3 .. it does not generate a session key can u please tell me what is going wrong ?

    am eagrly awating your reply

    thanxz

  158. Steven Robert on Thu, 25th Mar 2010 10:20 am
  159. Sammy, what’s the error that you are getting?

  160. Steven Robert on Thu, 25th Mar 2010 12:00 pm
  161. Hello Bruno and Luca,
    I was little busy this week, I was in Sun Tech Days 2010, at last, here is the post that helps you to publish on fan page as fan user using php, Let me know if you have still any issues. http://blog.theunical.com/facebook-integration/publish-on-facebook-fan-page-as-fan-user-using-php/

  162. Saurabh on Sun, 28th Mar 2010 1:52 pm
  163. Hi Steven,

    I could not post on the wall despite following the steps given on the blog. Please help. I am using the one time session key which is generated using the token code. Also , please let me know, how will the other users who are using my app will be able to post on their walls so that their frnds will get updates ?

  164. Steven Robert on Sun, 28th Mar 2010 10:46 pm
  165. Saurabh, check all the steps and all the fields of screen shots again. It will work. Other users need to give permission to their wall or Use some bookmarking tools, so that they can publish on their walls.

  166. kirochi on Mon, 29th Mar 2010 12:10 pm
  167. This code is good

    require_once ( ‘php / facebook.php’), / / the two folders you have downloaded it mounted the server

    $ api_key = “xxxxxxxxxxxxxxxxxxxxxxxxxx”;
    $ secret_key = “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”;
    $ facebook = new Facebook ($ api_key, $ secret_key);
    $ user = $ facebook-> require_login ();

    $ message = ‘news http://www.mega.cl test’;
    $ has_permission = $ facebook-> api_client-> users_hasAppPermission (publish_stream “);

    / / The user must give permission for your application publishes information on its wall.
    if ($ has_permission)
    (
    $ facebook-> api_client-> stream_publish ($ message);
    echo ‘posted the message’. $ message;
    )
    else (
    $ address = “http://www.facebook.com/connect/prompt_permissions.php?api_key =”. $ api_key. “& v = 1.0 & next = http://www.facebook.com/connect/login_success.html?xxRESULTTOKENxx&display = popup & ext_perm = read_stream, publish_stream & enable_profile_selector = 1 & profile_selector_ids = “. $ user;

    header ( “location: $ address”);

    )

    ?>

  168. Mirza on Tue, 30th Mar 2010 11:52 pm
  169. dear steven
    i have already follow the instruction but i get error
    can you help me ?
    i just need the simple code

    1. Status Update
    so when ppl use the aplication it would like :

    Name : i’m so busy
    posted from mysite

  170. Steven Robert on Wed, 31st Mar 2010 4:09 am
  171. Mirza, What’s the error you got?

  172. Rami on Tue, 6th Apr 2010 8:11 am
  173. Thank you so much,
    I spent so long trying to do it,
    and I could not have done this without this great guide.
    oh ye and there was a small bug i found:
    on step 3 this line is wrong:
    $fb = new FacebookRestClient(FB_APIKEY, FB_SECRET);
    and should be change to (since this parameters are not defined):
    $fb = new FacebookRestClient($FB_APIKEY, $FB_SECRET);

  174. sunetra on Fri, 9th Apr 2010 6:57 am
  175. hie steven ,
    Your above 5 steps are really helpfull for me thanks a lot !…..

    Now i want to display the images on Tab i have also mention the tab name and tab URL still it is not showing the content ..please help me…..

    Regards,
    Sunetra

  176. Steven Robert on Sat, 10th Apr 2010 9:58 am
  177. Hi Sunetra, which method you used to post on tabs?

  178. sunetra on Sun, 11th Apr 2010 2:00 am
  179. hello steven ,

    im using static FBML ..can we use iframe tags in Tab Canvas…..
    eg i have created my tab ” demophoto” and i want to display my data into the ” demophoto” i can use iframe ?

  180. Steven Robert on Sun, 11th Apr 2010 4:31 am
  181. Sunetra, You can use FBML. Need to check which is used to post on tabs.

  182. Omar Plummer on Tue, 13th Apr 2010 11:24 pm
  183. Thanks a lot. At first I found it confusing, (I’m new to facebook dev) but I got the hang of it. Extremely helpful

  184. Iva on Fri, 16th Apr 2010 9:29 am
  185. Steve, I thank you so much!

  186. newbie on Thu, 22nd Apr 2010 6:31 am
  187. hi steve nice tutorial,
    i just have a small problem.
    i was on step four and when i replaced the values with my API KEYS this is what i get:

    API Error Code: 100
    API Error Description: Invalid parameter
    Error Message: Param fbconnect must be a boolean

    Please please help me.
    What am i doing wrong?

    this is the one that i should be replacing right?
    –> APIKEYXxxxxxxxxxxxxxxxxx

    please guide me, im almost there but not quite. thanks in advance

  188. darrasin@freedom.com on Fri, 23rd Apr 2010 5:45 pm
  189. Steve – great tutorial and I thank you for the time and detail you put into it. I am having trouble with step #3 generating the session key. I downloaded your script generatesession.key.php put in my api key and secret but get the following error when executing:

    Fatal error: Uncaught exception ‘FacebookRestClientException’ with message ‘Invalid parameter’ in /web/sites/widgets/facebook/facebook-platform/facebook-platform/php/facebookapi_php5_restlib.php:3025

    Any advice is greatly appreciated.

  190. Rio MobineSSia on Fri, 23rd Apr 2010 11:57 pm
  191. I’m developing mobile web application (xHTML) in PHP which already success connected to fb.
    But I still confuse for asked permission (Step 4 on your guide above) in mobile way.
    Do you know how to adopt your Step #4 above to be run on mobile micro browser?
    Thx in advance.

  192. Steven Robert on Sun, 25th Apr 2010 8:02 am
  193. Rio You can execute Step4 in mobile version too

  194. Steven Robert on Sun, 25th Apr 2010 8:22 am
  195. Darrasin try the other link I updated in post for Step3.

  196. BKC on Sun, 25th Apr 2010 1:20 pm
  197. Love the blog. Step 4 failed with error fbconnect must be boolean. Replacing true with 1 seems to work.

  198. newbie on Sun, 25th Apr 2010 1:22 pm
  199. steve, u skipped my question :(
    help please. thanx

  200. Steven Robert on Sun, 25th Apr 2010 9:34 pm
  201. Yes BKC it seems facebook changed its api for true/false to 1/0.

  202. Steven Robert on Sun, 25th Apr 2010 9:36 pm
  203. Yes Uber,
    replace true with number 1 and try.

  204. Felix Gomez Jr on Mon, 26th Apr 2010 12:25 pm
  205. Hi Steven, do you have any idea how to post the message on the wall of a fan page?

  206. Steven Robert on Mon, 26th Apr 2010 9:42 pm
  207. Felix, Check this post http://blog.theunical.com/facebook-integration/publish-on-facebook-fan-page-as-fan-user-using-php/ to Publish on Facebook Fan Page as fan user

  208. Aarif on Wed, 28th Apr 2010 9:13 am
  209. hi steven

    very nice post thanks man. I am facing one issue.

    I want is abuot creating avatar and people can come and like or dislike any avatar. even this avatar is created by a friend or not.

    now i want my app to publish on person A wall, if person B comes and like his/her avatar in the app & both are not even friends.
    Both person A and B have given exntended permission to the app also and are not friend.

    I am using following publish stream code

    $facebook->api_client->stream_publish($message,null,null,$personA_id,$app_id)

    Its showing this error

    post on wallexception ‘FacebookRestClientException’ with message ‘The user hasn’t authorized the application to perform this action’ in /home/jill/web/php/facebook-platform/php/facebookapi_php5_restlib.php:3374 Stack trace: #0 /home/jill/web/php/facebook-platform/php/facebookapi_php5_restlib.php(932): FacebookRestClient->call_method(‘facebook.stream…’, Array) #1 /home/jill/web/public/samsung/style-n-win-dev/insert-services2.php(54): FacebookRestClient->stream_publish(‘From My App: pu…’, NULL, NULL, ’100000845001406′, ’109444382410730′) #2 {main}

    but if I use following code which person B comes and likes his own avatar it works and publish post on the wall without error.
    $facebook->api_client->stream_publish($message,null,null,$personB_id,$app_id)

    please can you guide me where i am doing mistake.

    thanks a lot

  210. Steven Robert on Wed, 28th Apr 2010 10:47 pm
  211. Aarif, It could be the Permission issue from Step4, check once

  212. dina on Sun, 2nd May 2010 3:00 am
  213. hi sir..
    i can’t download facebook library..
    the link above gave me error not found ..

    am i wrong?…

    thx

  214. dina on Sun, 2nd May 2010 9:00 am
  215. ive download from http://github.com/facebook/php-sdk
    but after run the code, i got this error,
    Fatal error: Call to undefined method stdClass::admin_setAppProperties()

    in my php code i’ve include
    require_once ‘./facebook.php’; // it is the same path with my index.php

    need a clue.
    thx

  216. Steven Robert on Sun, 2nd May 2010 9:01 am
  217. Hi Dina,
    Thanks for pointing that out, I have updated the link now. Facebook has changed that URL.

  218. dina on Mon, 3rd May 2010 3:10 am
  219. thx sir,
    it’s works

  220. Girl games on Wed, 5th May 2010 6:03 am
  221. Hi,

    I run the test code and got the following error:
    Fatal error: Call to undefined method Facebook::require_login() in /home/content/46/4899446/html/facebook/mytestapp/index.php on line 18

    Any idea?

  222. Aziz on Tue, 11th May 2010 5:48 am
  223. Steven does your library still works is everything ok? I performed all steps before and it worked but now i cant get to use the function from it. I have checked everything. When it comes for functions it stops.

  224. Steven Robert on Tue, 11th May 2010 8:19 am
  225. Aziz,
    Which function are u referring, Face book has changed some of the api settings.

  226. Aziz on Tue, 11th May 2010 9:07 am
  227. I am using
    $facebook->api_client->stream_publish();
    $facebook->api_client->photos_upload();
    $facebook->api_client->video_upload();

  228. Steven Robert on Tue, 11th May 2010 11:35 pm
  229. Aziz, Try download the library from above, facebook has changed its library. The methods you are using still work.

  230. Aziz on Wed, 12th May 2010 5:05 am
  231. Hmm… when i used this tutorial from begining it worked fine again and I have checked all my previous codes, they worked too. strange.. though. Anyway thank you again and for the tutorial again. I just wonder if it is possible to do the same with new api

  232. nikhil on Thu, 13th May 2010 8:10 am
  233. Hi Steven,
    Thanx for such wonderful description, its pretty easy as we go step by step.
    I was just wondering if my website can have ability to post on other user’s wall
    thanx

  234. Steven Robert on Thu, 13th May 2010 8:35 am
  235. Hi Nikhil, If the user gives permission to their wall then you can publish on their wall too.

  236. nikhil on Thu, 13th May 2010 8:45 am
  237. Ya I understand that but don’t they require their API Key and all, an average user won’t even take little pain to get their Keys
    What I need is that user could post on other person’s(friends ) wall.
    Thanx for quick response

  238. Steven Robert on Thu, 13th May 2010 10:42 am
  239. No Nikhil, Your API will be sufficient, They just need to give permission to their wall.

  240. Edgar on Mon, 17th May 2010 10:06 am
  241. Hi i tried several times to do it but i get this error exception ‘FacebookRestClientException’ with message ‘Session key invalid or no longer valid etc..
    Help!!

  242. lilongsy on Tue, 18th May 2010 11:37 am
  243. Hi Steven
    Very nice post thanks man. I am facing one issue.
    We can post the message to my Facebook wall, But the other user whole are using my app will cannot post message on their Facebook walls.
    Help!!

    Grace

  244. lilongsy on Tue, 18th May 2010 11:38 am
  245. can you give us the source code

  246. lilongsy on Tue, 18th May 2010 11:43 am
  247. require_login();

    $fb = new FacebookRestClient(FB_APIKEY, FB_SECRET);

    $facebook->api_client->session_key = $fb->do_get_session($fb->auth_createToken());

    $fetch = array(‘friends’ =>array(‘pattern’ => ‘.*’,'query’ => “select uid2 from friend where uid1={$user}”));

    echo $facebook->api_client->admin_setAppProperties(array(‘preload_fql’ => json_encode($fetch)));

    /*if( $facebook->api_client->stream_publish($message))

    echo “Added on FB Wall”;

    } catch(Exception $e) {

    echo $e . “”;*/
    //}
    //$message = ‘Check out this cute pic.’;
    $attachment = array(
    ‘name’ => ‘i\’m bursting with joy’,
    ‘href’ => ‘http://icanhascheezburger.com/2009/04/22/funny-pictures-bursting-with-joy/’,
    ‘caption’ => ‘{*actor*} rated the lolcat 5 stars’,
    ‘description’ => ‘a funny looking cat’,
    ‘properties’ => array(‘category’ => array(
    ‘text’ => ‘humor’,
    ‘href’ => ‘http://www.icanhascheezburger.com/category/humor’),
    ‘ratings’ => ’5 stars’),
    ‘media’ => array(array(‘type’ => ‘image’,
    ‘src’ => ‘http://icanhascheezburger.files.wordpress.com/2009/03/funny-pictures-your-cat-is-bursting-with-joy1.jpg’,
    ‘href’ => ‘http://icanhascheezburger.com/2009/04/22/funny-pictures-bursting-with-joy/’)),
    ‘latitude’ => ’41.4′, //Let’s add some custom metadata in the form of key/value pairs
    ‘longitude’ => ’2.19′);
    $action_links = array(
    array(‘text’ => ‘Recaption this’,
    ‘href’ => ‘http://mine.icanhascheezburger.com/default.aspx?tiid=1192742&recap=1#step2′));
    $attachment = json_encode($attachment);
    $action_links = json_encode($action_links);

    if($facebook->api_client->stream_publish($message)){
    echo “Added on FB Wall”;
    }else{
    echo “FB Wall failed”;
    }
    } catch(Exception $e){
    echo $e . “”;
    }

    ?>

  248. Namalak on Wed, 19th May 2010 8:42 am
  249. Hi,
    I am trying to develop a project using facebook -java-api.
    Here I want to extract the face book data and store them in a data base using the facebook-java-api. But I am new for this field.
    I connected to the facebook developers page and created a new application. Now I need to know how to get the face book data like friend list/ profile picture etc. and where to place these codes I’m going to write.
    If you can help me it is really appreciated.
    Thank you!

  250. Kuldeep singh on Fri, 21st May 2010 4:28 am
  251. its great man thanx a lot/////////
    i was working with facebook app development and searched a lot in developer wiki but couldn’t find that… great great post

  252. Krishna on Mon, 24th May 2010 8:23 am
  253. hi steven
    Its very nice post thanks, I am facing one issue.
    At Step2: Generate One Time Token to generate Session key ::
    We have many users in my site.so as per your coding how can we generate One time Token using php code for different logins.
    Please help us !!!!!!!

  254. Anulya on Fri, 11th Jun 2010 5:16 am
  255. I follow the steps until 5. i got one time token and session. Now I run in localhost, then it shows the error as below: post on wallexception ‘FacebookRestClientException’ with message ‘Session key invalid or no longer valid’ in /var/www/anulya/facebook-platform/php/facebookapi_php5_restlib.php:3025 Stack trace: #0 /var/www/anulya/facebook-platform/php/facebookapi_php5_restlib.php(2882): FacebookRestClient->call_method(‘facebook.admin….’, Array) #1 /var/www/anulya/facebook-platform/test.php(33): FacebookRestClient->admin_setAppProperties(Array) #2 {main}
    Any help Please Thank you

  256. saran on Tue, 15th Jun 2010 10:05 am
  257. Hi to all,
    I have created th facebook application and i set the all permission for user to access. I want to get the session key for every user dynamically… by using this url http://www.facebook.com/code_gen.php?v=1.0&api_key=YOUR_API_KEY we cant get it dynamically… we can get by manually…. A thing is that, One user will come to my site, while he login i want to store all his information in DB with seesion key for offline access…. Another user ll.. as usually want to get… Please help to get it… very urgent…

    I am starting the connection with this url http://m.facebook.com/authorize.php?api_key=YOUR_API_KEY&v=1.0&ext_perm=offline_access

    if this url returns session key it ll be appreciated…

    thanks
    saran
    http://careerjobz.com

  258. kamarul on Wed, 16th Jun 2010 6:49 am
  259. Hi steven,

    Thank you for your reply in few hours ago. Yet i still can find any solution for my problem.

    When i open the page. It only echoed post on wall. No great wall appear. You may check it out here. http://h3llst0rm.phpnet.us/upd/haha.php

    Hope you help me to sort this out. Thx

  260. Junior on Mon, 21st Jun 2010 4:40 am
  261. Hi Steven!

    thank you very much for yours articles!

    I would only know if it’s possible to add “Friend tags” or “Page tags” in stream_publish (using FBML libraries).

    ( Es.: “@[ID:4387]” -> “John” prefer pasta to pizza )

    bye

  262. piv64 on Mon, 21st Jun 2010 8:47 am
  263. Hi,
    I don’t undersantd why, but Step 4 never show me 3 screens.
    I only got “success” displayed.

    You told :
    ‘If you don’t see the below then your call back URL or Canvas URL must be incorrect, please check again your application settings and execute the URL again.’

    Can you give more explain please, my facebook application is running and everything seem good in definition of application.

    Note: I want to post messages on my wall thrue application in batch mode, not in browser context.

    Thanks for your reply

  264. Steven Robert on Mon, 21st Jun 2010 11:03 pm
  265. @piv64, you can do batch updates, the back URL or Canvas URL will be there in facebook setting page,

  266. Steven Robert on Mon, 21st Jun 2010 11:04 pm
  267. @Junior, you can add tags too

  268. piv64 on Tue, 22nd Jun 2010 5:39 am
  269. Hi,
    In fact, even if nothing else than ‘success’ is displayed, configuration for write autorization on my facebook wall is good.

    Important:
    I saw a solution on application parameters in way to diagnose publish problems.
    If application is defined as ‘desktop’, everything run and many obscured problem related to stream_publish are solved.
    I think that lots of people are interested by this.

    An other problem, is there a solution to send message with accent (french text) and what’s the solution for message encoding ?

    Thank for your reply.

  270. Junior on Tue, 22nd Jun 2010 10:08 am
  271. Hi Steven,

    I thank you for the quick response!

    I’m trying with this simple code but don’t work:

    $message = ‘This message is sent by ‘;

    The problem is that facebook does not view tags and show the string as it is…

    see ‘ya

  272. Steven Robert on Wed, 23rd Jun 2010 12:13 am
  273. Junior on Wed, 23rd Jun 2010 7:02 am
  274. Hi Steven,

    I tried but the script does not work as I want … maybe I have not explained well …

    When I post a new message on my wall I would like the tagged user display a message in its notifications like “Junior have tagged you in a post.”

    Currently, when I insert the tag as you suggested is not sent any notification to the recipient but only shows a link.

    How can I do?

  275. Steven Robert on Wed, 23rd Jun 2010 10:11 am
  276. @Junior yes its just a link tag

  277. orkut scraps on Thu, 24th Jun 2010 3:20 pm
  278. please add a lesson for sending images to facebook wall in actual sizes

  279. Mr Blass on Sat, 26th Jun 2010 9:50 pm
  280. Thanks for the tut, i tried all the steps and it worked but i would like to use this link… https://graph.facebook.com/oauth/authorize?client_id=xxx&redirect_uri=http://apps.facebook.com/xxxx/&scope=publish_stream … in step 3.. i used the SESSIONKEY that was given to my profile and it worked… but how can i obtain the sessionkey that each user gets after granting the app permission? any way to grab theirs? i only want to post on their feeds/wall when they are online… i still don’t understand how to get each user’s sessionkey and send a post on each one of them. Thanks for any help

  281. Junior on Sun, 27th Jun 2010 12:44 pm
  282. Hi Steven,

    it’s possible to publish a message on the wall of the friends of the app/funpage?

    Ex.:

    1. User visit my site

    2. The user publish a message on my site

    3. My site publish this message on the facebook wall of the User

    how do I write permissions?

  283. Ernestas on Mon, 28th Jun 2010 6:34 pm
  284. Same question as Junior.

  285. dinesh on Wed, 7th Jul 2010 3:27 pm
  286. is there any script by which i can use user’s facebook login details, and can post something on user’s wall, as this can be done for twitter using cURL lib of php

    thanks in advice ….

  287. Joomla Outsource India on Sat, 17th Jul 2010 6:39 am
  288. Hi,

    I want to run a continuous fb wall posting from my cakephp code, Is there any way of doing the same, without generating this one time session key?

    If yes, earliest reply would be appreciated!

    JOI

  289. Steven Robert on Sun, 18th Jul 2010 5:15 am
  290. @Joomla its mandate to generate the key

  291. Joomla Outsource India on Sun, 18th Jul 2010 11:07 am
  292. @Steven, thanks for your time and reply. Yes session key generation is must, but Is there a way; via my php script, it can generate automatic session and then post some message to users wall?

    I am running another code, for twitter, into which tweeting message, which is working perfect as needed from our project source code, but for facebook I am not able to find much useful info, so would be appreciated, if you can help somehow to get facebook wall posting working from my website script dynamically/automatically !

    Thanks in advance!

  293. Jeff on Thu, 22nd Jul 2010 5:40 pm
  294. I’m getting the following error when trying to run the code. I actually tried combining the snippets into 1 page and this is what I got. Any ideas?

    Fatal error: Uncaught exception ‘FacebookRestClientException’ with message ‘Invalid parameter’ in /home/webdad3/public_html/AlphaProject/library/facebook-platform/php/facebookapi_php5_restlib.php:3025 Stack trace: #0 /home/webdad3/public_html/AlphaProject/webservice/ws_facebookPublishing.php(14): FacebookRestClient->call_method(‘facebook.auth.g…’, Array) #1 {main} thrown in /home/webdad3/public_html/AlphaProject/library/facebook-platform/php/facebookapi_php5_restlib.php on line 3025

  295. Jeff on Thu, 22nd Jul 2010 6:02 pm
  296. Ignore my comment. I got it to work. The tutorial does what it says it does :)

  297. Steven Robert on Thu, 22nd Jul 2010 11:44 pm
  298. @ Jeff you can’t combine all the steps in one page, you need to do it seperatly

  299. Jeff on Sat, 24th Jul 2010 9:41 am
  300. Ok… I followed the tutorial and it does what it says, but not what I thought it was going to do. Do you know how I can have the application post to its own wall?

    For example if a user of the site does something, I want the site to post to the application wall so all that like the application will get that as part of the news feed.

    I can’t seem to find this anywhere.

  301. Joomla Outsource India on Sat, 24th Jul 2010 11:38 pm
  302. @ Jeff

    hello Jeff, you can try to find something useful for you at below link:
    http://wiki.developers.facebook.com/index.php/Stream.publish

    They have specially mention “A developer of the application must edit the application profile page’s Wall Settings (Edit Application > Edit) and verify under Posting Ability that Fans can write or post content on the wall is checked.”, so I am thinking its for you, which you’re finding!

    Cheers!

  303. Yaco Zaragoza on Fri, 6th Aug 2010 2:58 pm
  304. I am trying to make an application that allows users to select 4 different options from list that I will be providing them and I want to submit that to my wall. Can you help me set this up?

    This is what I have so far
    http://apps.facebook.com/activity_selection/

    Thanks
    Yaco

  305. dinesh pal on Wed, 18th Aug 2010 7:44 am
  306. hi!
    Steven Robert
    First thanx for posting the good article …i also doing this but one problam come that when i give the url of canvas and connect after that click save button i found a error that your api key is invalid..what’s problam ..and i also want to know in canvas and connect url which links will be given..please help me….
    thanks

  307. dinesh pal on Wed, 18th Aug 2010 7:48 am
  308. hi!!
    actually i working on the local copy for r&d and after this i will used on the originol sites.
    thank
    dinesh pal

  309. Steven Robert on Wed, 18th Aug 2010 1:42 pm
  310. @dinesh you can give any public URL unlike this local url like 192.168.0.9

  311. dinesh pal on Thu, 19th Aug 2010 2:59 am
  312. hi Steven Robert
    good morning
    after complted the first step when i start step to and click the given url then i found a error like this(‘Invalid API key specified’.).what’s the mistake..please solve this problam..
    thanks
    for your help and support

  313. dinesh pal on Thu, 19th Aug 2010 8:00 am
  314. hi
    steven
    where i copy the step 3 code….and how imlement this on your module…please give me responce..
    thanks

  315. Steven Robert on Fri, 20th Aug 2010 11:54 pm
  316. @Dinesh for Step2 don’t run it directly on it just replace your APIkey and open it in browser. And for Step3 It will generate a unique session key just use it for Step5

  317. dinesh pal on Mon, 23rd Aug 2010 1:07 am
  318. thanks

  319. Steve on Thu, 26th Aug 2010 7:15 am
  320. Class ‘Facebook’ not found in /var/vhosts/apartmentsneakpeeks/httpdocs/facebook-platform/php/facebookapi_php5_restlib.php on line 82

    Rest was fine but in the last due to session value is “” i could not make the post done.

    Will you please mail me regarding this.
    Thanks and Regards,
    SHyam

  321. Malcom on Mon, 30th Aug 2010 3:47 pm
  322. Hi Steven,

    can you assist me with an API for FB offline messages..am unable to do that..

    The script you mentioned here is for the online messages not offline

    Thanks in advance

  323. fd on Thu, 9th Sep 2010 5:47 am
  324. everything is working nice, thanks for the script.

    What about character encoding? Accent characters not shown. I do not find how to set char set

  325. Khushal on Thu, 9th Sep 2010 7:41 am
  326. Hi Steven,

    I need to post comment on my application users selecting from my data base but very confused in that. There are a number of ways given on the net apart from each other . I just setup tha application. Now want that the user who add the application his user id will be stored in my database and I can post some kind of rank for each users from my db

  327. Ravi on Fri, 10th Sep 2010 4:36 pm
  328. One strange problem i got is that.. when i first went on with the steps i got my postings to my wall. I tried it for another facebook profile and didnt succeed.Again i replaced the old code in my server and tried toxecute post to wall. now i am getting
    Error
    123exception ‘FacebookRestClientException’ with message ‘Session key invalid or no longer valid’ in /home/socialcr/public_html/beta/facebook/fb_app/facebook-platform/php/facebookapi_php5_restlib.php:3025 Stack trace: #0 /home/socialcr/public_html/beta/facebook/fb_app/facebook-platform/php/facebookapi_php5_restlib.php(2882): FacebookRestClient->call_method(‘facebook.admin….’, Array) #1 /home/socialcr/public_html/beta/facebook/fb_app/publish on wall.php(16): FacebookRestClient->admin_setAppProperties(Array) #2 {main}

    Then with the above key execute the below URL in browser to give access to your program.
    http://www.facebook.com/login.php?api_key=APIKEYXxxxxxxxxxxxxxxxxx&connect_display=popup&v=1.0&next=http://www.facebook.com/connect/login_success.html&cancel_url=http://www.facebook.com/connect/login_failure.html&fbconnect=true&return_session=true&req_perms=read_stream,publish_stream,offline_access

    Plz make me clear with this…..

  329. Ravikumar on Tue, 14th Sep 2010 11:12 pm
  330. Hi stephen… when i was posting $message value iam exactly getting the message displayed in facebook wall .
    example :$message=”34% post opinions about products and brands on their blogs – Interested in profiting from social media? Try http://ow.ly/16C88 “;
    It is posting well.
    but when i tried to retrieve the same messages from my database like $message=mysql_fetch_row($tag_query); the message is displayed as

    ‎["34% post opinions about products and brands on their blogs - Interested in profiting from social media? Try http:\/\/ow.ly\/16C88\r"]
    plz make me clear with this mate
    Thanks in advance

  331. mukhan86 on Mon, 20th Sep 2010 7:50 am
  332. I got this error….. Any help plz…..

    post on wallexception ‘FacebookRestClientException’ with message ‘Invalid API key’ in /home/snauman/public_html/therunaround/facebook-client/php/facebookapi_php5_restlib.php:3025 Stack trace: #0 /home/snauman/public_html/therunaround/facebook-client/php/facebookapi_php5_restlib.php(2882): FacebookRestClient->call_method(‘facebook.admin….’, Array) #1 /home/snauman/public_html/therunaround/Udefinesuccess/index.php(27): FacebookRestClient->admin_setAppProperties(Array) #2 {main}

  333. Shane Fernando on Tue, 28th Sep 2010 11:40 am
  334. I would like to know if we can do both requesting permissions and executing our code in the same page,

    because when i make the user type in the following url,

    http://www.facebook.com/login.php?api_key=APIKEYXxxxxxxxxxxxxxxxxx&connect_display=popup&v=1.0&next=http://www.facebook.com/connect/login_success.html&cancel_url=http://www.facebook.com/connect/login_failure.html&fbconnect=true&return_session=true&req_perms=read_stream,publish_stream,offline_access

    i cannot check whether he has successfully done it.

    ne ideas will be greatly thankful

  335. zootyo on Mon, 11th Oct 2010 5:16 am
  336. Hi!

    Great post!
    I would like to ask your help. I have multiple pages, created with open graph protocol, and I want to post on the page’s wall. The problem is, that the pages are created dynamic: when there is an event, I store it in a database, and I generate an open graph protocol page for the event.
    How can I post to the page’s wall? I tried putting the page’s url as target_id, but no result; I tried your code, but I’m stuck at step 3 (104 Incorrect signature method facebook.auth.getSession session_key api_key [my_app_key] v 1.0); and a few other things, but no result. :(
    Any help would be appreciated!

  337. Pieter on Mon, 11th Oct 2010 5:49 am
  338. Hi All,

    I’m new to developing for Facebook so sorry if my question is a stupid one!
    I would like to set up the above example but I always get an error at Step 2.

    The error is :
    API Error Code: 100
    API Error Description: Invalid parameter
    Error Message: next is not owned by the application.

    Anyone who can help me?

    Thx,

    Pieter

  339. shevy on Tue, 12th Oct 2010 12:12 pm
  340. HI,
    I keep on getting stuck in step #4,
    I get the following message:
    “To fix this error, please set your Connect URL in the application settings editor. Once it has been set, users will be redirected to that URL instead of this page after logging in.”
    What can the problem be?
    Please can anyone help – I’m stuck!!!!!

  341. Sumit Singhal on Thu, 14th Oct 2010 1:10 am
  342. Hi,
    Thanks for this lovely article. This article is very help full for me and i am able to post on user wall text as well as image but my problem in step 3 calling URL from browser its working but i want to fetch the user offline session-id from my web page using this URL how can i achieved this or any alternate way is there for getting user offline session-id?

    Using java.

    Please help me.

    Thanks allot.

  343. Steven Robert on Thu, 14th Oct 2010 11:21 pm
  344. @Sumit using php you can check the above code , in java in need to verify the api

  345. Furqan on Fri, 15th Oct 2010 4:35 pm
  346. hey steven , nice article , but i a newbie with fb development. i want to create a poll application . i can handle the php stuff . but i want my application to post of on friends (of the current app user) wall. is that possible ? if yes can you direct me to the right direction.

    and i have seen applications that do automatic posting on user’s friends walls at random , any tips or links on how that can be achieved.

    your blog is awesome.

    Thanks,
    Furqan

  347. shevy on Sun, 17th Oct 2010 11:20 am
  348. Call to undefined method FacebookRestClient::stream_publish()
    any clue whats wrong??

  349. Sumit Singhal on Tue, 19th Oct 2010 2:42 am
  350. Hi Steven,

    Thank you very much for reply,

    But now i am able to fetch the user offline session id using FB JavaScript.

    Thanks alot.

    Regards
    Sumit

  351. Daniel on Fri, 29th Oct 2010 3:23 am
  352. thank you! it works

  353. praveenkumar on Fri, 29th Oct 2010 5:48 am
  354. Gopinath on Sat, 20th Nov 2010 7:55 am
  355. Hi ,Dude

    1. Could you plz inform me where i have to use step 3 and 5.

    2. where i have to use save my login info code.

    3. finally , i got worked up with this code and the result is login page as well as request page i grant the permission “allow” after that this code is not responding itz still loading..

  356. baljeet on Mon, 22nd Nov 2010 8:31 am
  357. I did not see the Connect link in my application.
    I only see About, Website, Facebook Integration, Mobile and devices, Advanced links.
    Please help …


    Baljeet

  358. Kim an on Thu, 25th Nov 2010 4:24 am
  359. I have follow all the step of ur steps. But when i run ur code, it said Call to undefined method stdClass::admin_setAppProperties(). Can u help me pleas?

  360. baljeet on Sat, 27th Nov 2010 3:33 am
  361. Hi Steven, Thanks a lot. I have been struggling to post to my fan page wall using php for last three weeks. Now I’m able to post to my own wall, and its a great step towards my goal.

    actually I’m creating a free for all application where the people can publish messages, photos, videos, events to their pages.

    Please guide me how to publish the message on fan page wall.

    Thanks in advance
    Baljeet
    baljeets91@gmail.com

  362. baljeet on Sat, 27th Nov 2010 6:25 am
  363. Hi Steve,

    Hurray !!

    I’m able to post to fan page now. I”ve one question which I’m posting on
    http://blog.theunical.com/facebook-integration/publish-on-facebook-fan-page-as-fan-user-using-php/comment-page-1/#comment-9298

  364. edan cohen on Sun, 28th Nov 2010 2:22 pm
  365. Is this method still working, or we must now use OAuth 2.0.
    I am getting an error on step 2: “An error occurred. Please try again later.

    Thanks

  366. Happismiley on Mon, 29th Nov 2010 3:55 am
  367. Hi Steven,

    Thanks for your great tutorial!

    Sorry to digress. But how do I allow users to register and login using their Facebook account? (the single sign-on) I cant seem to integrate Facebook with Webid for the login part. How do I authenticate users who have registered using their Facebook account to use my site & post the above news feed?

    I’m using PHP, thanks! Hope to get a reply from you soon!

  368. Steven Robert on Mon, 29th Nov 2010 10:56 pm
  369. Edan, All the methods are working

  370. bod on Tue, 30th Nov 2010 12:04 am
  371. I’m getting the same error as @185, Steven can you please confirm that this is actually working? I can’t see any way of getting around this.

  372. baljeet on Tue, 30th Nov 2010 3:10 am
  373. Hi Happismile,

    If you follow all the steps described here, there should be not problem.
    In step 3, you will get permanent session key which will be used for logging in to facebook from your site. If your site has more than one users, then you can same their session keys in local database, that session key will be used for posting, or viewing the facebook data for that user.

    Please let me know where you are facing the problem.


    Baljeet

  374. art on Tue, 30th Nov 2010 9:56 am
  375. Hello Steven, Thanks for your help!

    Today the facebook API on step 2 suddenly worked so every thing is ok.

    I have a new question, I need to post a message to a Page I own (and not to my user), can you point me to the right direction?

  376. happismiley on Sat, 4th Dec 2010 1:45 am
  377. Hi Balijeet

    Thank you for your prompt response!

    I’m using localhost as my testing server. So after I completed the 5 steps above, I’m the only Facebook user able to publish on Facebook wall.

    I want to allow other Facebook users who use my site to also publish on Facebook wall. How do I get their session key using PHP for Step 2 & 3 and then save it to my database?

    Thanks!
    Happismiley
    cbx006@gmail.com

  378. baljeet on Mon, 6th Dec 2010 1:25 am
  379. Hi Happy, sorry for the late response due ti weekend.
    If you ready the steps properly and know php, there should be no problme. Further, you can give my you email id, I’ll send the code I have done in php, with explanation.

  380. happismiley on Mon, 6th Dec 2010 4:16 am
  381. Hi Balijeet

    My email address is cbx006@gmail.com.

    Anyway, does anybody know whether Facebook change their api again? I cant access my “Connect to Facebook” button since yesterday. ):

    Thanks!
    Happismiley

  382. baljeet on Tue, 7th Dec 2010 11:36 am
  383. [...] Here is a wonderfull step-by-step manual how to do it “5 Steps to publish on a facebook wall using php“. [...]

  384. gaurav on Mon, 13th Dec 2010 3:22 pm
  385. hi i have understood and it works for me if i do manually setp 2 and 3.

    i want my php script to perform step 2 and step 3 automatically when user login into my app. how can i do it?

  386. baljeet on Wed, 15th Dec 2010 1:53 am
  387. Hi Gaurav,
    2nd and 3rd steps can be merged and can be automate dusing php. You just need to call below url (make sure yiu replace value of next quesry string to the url where you want to redirect after success.):

    http://www.facebook.com/login.php?api_key=YOURAPIKEY&connect_display=popup&v=1.0&next=http://www.facebook.com/connect/login_success.html&cancel_url=http://www.facebook.com/connect/login_failure.html&fbconnect=true&return_session=true&session_key_only=true&req_perms=read_stream,publish_stream,offline_access

    If you are looking for ready-made php script for this go here
    http://www.fbsmm.com/2010/12/04/simple-example-to-post-on-facebook-wall-using-php/
    I have created this a sample script based on the steps discussed here by Steve.

  388. arduinomark on Thu, 16th Dec 2010 11:15 am
  389. great tutorial! … but I at step 2 I am getting the same error message as @185 and @188: “An error occurred. Please try again later.” tried different things but can’t get it work:( … not sure if I selected “Web” app correctly, the facebook interface for creating apps changed in the meantime. and re Canvas URL, can I type in any random URL or does it need to be a specific one? cheers!

  390. Tomas Teicher on Tue, 21st Dec 2010 11:47 am
  391. I am able to send only plain text. When I send some HTML tags like <img… it does not work. Is there any solution to send to facebook wall HTML text too?

  392. baljeet on Wed, 22nd Dec 2010 1:40 am
  393. for showing images, you have to actually post an image to the wall.
    Follow this
    http://blog.theunical.com/facebook-integration/add-picture-on-facebook-wall-using-php/comment-page-1/

  394. Rajkumar on Wed, 22nd Dec 2010 1:59 am
  395. I am Stuck in Step 2
    Generate One Time Token to generate Session key

    I am Not able to get the token , an error occurred while clicking the link with my app key…

  396. Steven Robert on Wed, 22nd Dec 2010 9:55 pm
  397. Raj Check if you created your Facebook app correctly.

  398. Steven Robert on Tue, 28th Dec 2010 11:11 pm
  399. FaceBook is deprecating some APIs from Jan 11, so please beware of when you create facebook apps
    http://blog.theunical.com/facebook-integration/facebook-deprecating-some-apis-from-07-jan-11/

  400. arduinomark on Mon, 3rd Jan 2011 5:13 am
  401. it seems that some people here are stuck at step 2. I had the same problem (see post 198), and did some further research. it turns out that there is a simple alternative solution with the Graph API- got it working with a 4 step procedure as described below.

    It is still a manual solution though… I would be very interested in getting this automated. apparently one should use Graph API in future anyways, as some of the API functions used above might be deprecated soon. So a combination of the solution posted below and the php-solution to automatise this procedure as described in previous posts would be terrific… ideas anyone?

    Here’s the how I did it with the Graph API:

    1) Register a Facebook application and get App ID and App Secret 
http://developers.facebook.com/docs/guides/canvas

    2) Ask the user for permission to publish posts on his wall
    (see http://developers.facebook.com/docs/authentication/#authenticating-users-in-a-web-application)

    https://graph.facebook.com/oauth/authorize?client_id=FACEBOOK_APP_ID&redirect_uri=http://www.URL/&scope=offline_access,publish_checkins,publish_stream

    - with client_id = your Facebook app ID, and is your and client_secret = your facebook application secret.
    - use scope argument for extended permissions (i.e. offline_access, publish_stream), you need those in order to post messages on a user’s wall (http://developers.facebook.com/docs/authentication/#requesting-extended-permissions)

    3) You will be redirected to the specified redirect_url. Copy verification string in the ‘code’ argument from the redirect URL, and paste it into this URL to get (permanent) Access Token:

    https://graph.facebook.com/oauth/access_token?client_id=FACEBOOK_APP_ID&redirect_uri=http://www.URL/&client_secret=VERIFICATION_STRING

    4) Browser returns Access Token. Use Access Token and Graph API functions to post messages
 to user’s wall

    …for further infos and examples see http://developers.facebook.com/docs/reference/api/post, e.g.

    curl -F ‘access_token=ACCESS_TOKEN’ \
    -F ‘message=Hello World. I like this new API.’ \
    -F ‘link=http://www.example.com/article.html’ \
    -F ‘picture=http://www.example.com/article-thumbnail.jpg’ \
    -F ‘name=Article Title’ \
    -F ‘caption=Caption for the link’ \
    -F ‘description=Longer description of the link’ \
    -F ‘actions={”name”: “View on Zombo”, “link”: “http://www.zombo.com”}’ \
    -F ‘privacy={”value”: “ALL_FRIENDS”}’ \
    -F ‘targeting= {”countries”:”US”,”regions”:”6,53″,”locales”:”6″}’ \
    https://graph.facebook.com/FACEBOOK_USER_ID/feed

  402. Sundar Thirugnanam on Mon, 3rd Jan 2011 7:27 pm
  403. Hi,

    This seems to be a good starting point. I was able to create an app and get my wordpress blog into facebook, but wanted to add functionality like updates to users on new post etc.

    I am yet to try the steps provided, but from the detailed instructions I think it should not be such a difficult task.

    Thank you for the wonderful tutorial.

  404. mbu on Tue, 11th Jan 2011 7:18 am
  405. Thanks a lot Steven, for your good tutorial for us.

    I have a Quiz Application in the facebook Platform, I want to publish my quiz result in the news feed from a quiz application.The application is developed in IFRAME base.
    Please give me code or instruction to me.
    Please help me.

  406. Steven Robert on Tue, 11th Jan 2011 11:31 pm
  407. @Mbu The above same code works, while giving permission you just need to give for news feed too.

  408. Johnny on Mon, 24th Jan 2011 7:01 pm
  409. Thank you, thank you, thank you! :) I have been searching the web for 3 days for this and nothing worked! Excellent tutorial!

  410. Prashant Parashar | links for 2011-01-26 on Wed, 26th Jan 2011 9:06 pm
  411. [...] 5 Steps to publish on a facebook wall using php | TheUnical Technologies Blog (tags: tech development web social-networking) [...]

  412. james on Fri, 28th Jan 2011 7:23 am
  413. Hello steven,

    First of all thanks a lot for a great article. I have one question If i want to post on my friends wall who is using this application. What modification i need to do in your script. So that i can post on my friends wall without login.

    Thanks

  414. Power Supply Tester on Sat, 29th Jan 2011 10:33 am
  415. Great post. Thank you for your contribution. Now we can finally post to our wall using php.

  416. mbu on Mon, 31st Jan 2011 1:14 am
  417. Dear
    I have a Quiz Application in facebook platform and when I click the submit
    button after correct the question then form data would not submit in the result
    page using the Internet Explorer but in Firefox this is correct.
    Also if I try secondly after first time in IE the result of a form data would
    submit and result is come.
    I was spent my huge time to correct this but i can’t do it.
    What is the problem and which will be suggestion to me to solve this problem.
    Please suggest me…

    With regards

  418. madmax on Mon, 31st Jan 2011 11:51 am
  419. Nice post. This is how to post a message in your facebook wall, do you know how to post a link and change its description to facebook?

  420. Vicky on Tue, 1st Feb 2011 5:47 am
  421. Hi Steven,

    I have follow your guide, all sucess until step 5. I got only an echo “post on wall” print on screen and then blank page, and there was no post public on my facebook wall.

    I see that you answer all the previous post, hopefully mine too. Thanks in advance.

    Vicky

  422. Steven Robert on Tue, 1st Feb 2011 1:49 pm
  423. @Vicky Check the permissions again, or see if the page is authorized to publish the post.

  424. Steven Robert on Tue, 1st Feb 2011 1:53 pm
  425. @Madmax see my other post who to post images u will get it. Add Picture on facebook

  426. Anton on Thu, 3rd Feb 2011 9:53 am
  427. I sent a message to the user’s wall, the operation was successful, but the message was in spam on the wall. Why?

  428. Tejas on Tue, 8th Feb 2011 3:43 pm
  429. Hi Steven, firstly thanks a lot for your tutorial. I have a question though: I followed your steps and was able to post to my facebook wall from my website. However even when someone else accesses my website it posts to my wall only. Not their wall. Am I missing something? Do we need to perform all the 5 steps with each user? Please guide me. I am very new to facebook API and I am probably doing something very foolish. Appreciate your help.

  430. Nagarjuna on Fri, 11th Feb 2011 8:06 am
  431. I am done with all the steps successfully…wow..great explanation..I am PHP developer but new to Facebook App….

    I am done with Steps 1,2 and 4 ..yeah I got success page .. But I am unable to generate one time session key(Step 3) …I GET BLANK WHITE PAGE..no matter how many times I am trying(From past 1 day)..

    What is the issue..please suggest….Thanks in advance

  432. Tokio Hotel on Mon, 14th Feb 2011 6:35 am
  433. Hello All

    How can we transform the update text to a update link ?

    How use $action_links and $attachement with this code ?!

    My code:

    $page_id =”xxxxxxxxxxxxxxxxxxx”;

    if( $facebook->api_client->stream_publish($message, $attachment,$action_links, null,$page_id))

    Thanx a lot :’))

  434. Steven Robert on Mon, 14th Feb 2011 10:12 pm
  435. lizzy on Tue, 15th Feb 2011 5:25 am
  436. Hi Steven, today I have an error on “Step2: Generate One Time Token to generate Session key”

    I changed the “API_KEY” to mine from the link:
    https://login.facebook.com/code_gen.php?api_key=API_KEY&v=1.0

    But it gave me an error message of:
    “An error occurred. Please try again later.” with “Okay” button underneath.
    I clicked on that “Okay” button, but it gave me the same message.

    What does it mean? And how to resolve this? Thank you.

    PS:
    Well, I got it work fine yesterday, until facebook thought there’s something ‘funny’ going on and got my facebook temporary ‘suspended’ (maybe because I kept on trying to post quite frequently using php? :p).
    Then facebook asked to reset my password.
    And it went back to normal again.
    BUT, my apps GONE :(

    Couldn’t be bothered to try it again last night, so I tried your 5 steps again today.
    And everything works but not until I got to step 2.

    Help please?

    Thank you, Steven.

  437. Steven Robert on Tue, 15th Feb 2011 11:16 pm
  438. @lizzy, I seen that many FB users have similar problem, FB doesn’t work same for all users all the time, it will give some errors sometimes, keep try after some time.

    [...] application page blog.theunical.com [...]

  439. Joe Davila on Sat, 19th Feb 2011 8:56 pm
  440. I am getting the following error in Step 3 (Generating the Permanent Session Key).

    Fatal error: Class ‘FacebookRestClient’ not found in /home1/mermagic/public_html/test/session-key.php on line 7

    Can someone please tell me where the Facebook php sdk should be located in order for the code to use it?

  441. Yogi on Tue, 22nd Feb 2011 4:48 am
  442. Hi Steven, i want to ask something, what is “{$user}” in step 5 line 23?
    I still can not post something to my wall.. when i execute step 5 its just show “post on wall” on the browser.. no error message or “Added on FB Wall”

    @ Joe Davila: FacebookRestClient class is on \facebook-platform\php\facebookapi_php5_restlib.php

  443. Mukta on Thu, 24th Feb 2011 5:43 am
  444. Hello
    When i go for step two i am getting error : An error occurred. Please try again later.

    I am not able to move forward.

    I have verified the API key which is correct then what would be the possible reason.

    Please reply.

    Thanks
    Mukta

  445. Steven Robert on Thu, 24th Feb 2011 11:38 pm
  446. @Mukta It seems facebook has changed some settings, After you created your application try to given permissions step4 then try other steps.

  447. Mukta on Fri, 25th Feb 2011 2:30 am
  448. Hello Stevan
    Thanks for your reply.

    As per your replay I given permissions to my application as mentioned in step4 but facing the same error.
    Now what would be the possible reason?

    You wrote :
    # 24th Feb 2011 11:38 pm

    @Mukta It seems facebook has changed some settings, After you created your application try to given permissions step4 then try other steps.

    Thanks
    Mukta

  449. Mukta on Fri, 25th Feb 2011 4:23 am
  450. Hello Stevan

    Suddenly step two error has stopeed coming and I have moved to step4.
    But in step 4 I am getting following url and I am not able to complete all the steps.

    http://www.facebook.com/developers/login_error.php?app_id=165631503489774&connect=1&type=connect

    Please try to give me solution ASAP.

    Thanks
    Mukta

  451. Steven Robert on Fri, 25th Feb 2011 11:27 pm
  452. vivek on Sun, 27th Feb 2011 1:59 pm
  453. thanks i was looking for this code for posting a message on user’s wall , thanks again.

  454. fern on Tue, 8th Mar 2011 9:09 am
  455. need help here. I can’t find CONNECT tab.

  456. Steven Robert on Tue, 8th Mar 2011 11:39 pm
  457. @fern, FB has changed its menu bars, soon I will update this post, mean while check for remaining menus

  458. khadija on Wed, 9th Mar 2011 6:22 am
  459. Hello Steven,

    In step 4 if i m getting following url and I am not able to complete all the steps.

    http://www.facebook.com/developers/login_error.php?app_id=138228446242989&connect=1&type=connect

  460. fern on Thu, 10th Mar 2011 1:04 am
  461. @Steven Robert: please update this as soon as possible. tnx!
    I’ll wait for the update.

  462. nakres on Fri, 11th Mar 2011 10:43 am
  463. hi, I would like to automaticly post on tmy application user’s wall when they use the application with a ,sentence, image back link, and connect link or something.
    i have the permission set

    can you help me please? and also how can i sometimes post on all user’s wall once in a while?

    thank you

  464. Steven Robert on Sun, 13th Mar 2011 3:01 am
  465. Hello All, I just updated the post will all latest screen shots and updated post content.

  466. ecommerce developer on Mon, 14th Mar 2011 1:03 am
  467. Every time when i post n this blog, the comment will not approve immediately, it takes time, but after taking time my comment was not appearing on the topics why is it so, is there any reason please mention,..

  468. khadija on Tue, 15th Mar 2011 2:07 am
  469. Hi,
    I am done with posting my data on wall.I was facing problem with step 4 for permission. I have used the following url:

    http://facebook.com/authorize.php?api_key=MYAPPAPIKEY&v=1.0&ext_perm=publish_stream&next=http://blinkbee.com/profile

    @Steven:Thanks a lot ur tutorial helped me a lot.

  470. Steven Robert on Tue, 15th Mar 2011 2:33 am
  471. @khadija Did u replaced the MYAPPAPIKEy with your facebook app id?

  472. khadija on Tue, 15th Mar 2011 6:42 am
  473. @Steven:No, I replaced my app key with MYAPPAPIKEy.

  474. Steven Robert on Tue, 15th Mar 2011 10:48 pm
  475. khadija on Thu, 17th Mar 2011 7:41 am
  476. Hi Steven,

    If i m using that url i m getting following error:

    http://www.facebook.com/developers/login_error.php?app_id=138228446242989&connect=1&type=connect

    Thanks,
    khadija

  477. Michael Lasell on Thu, 17th Mar 2011 4:09 pm
  478. Hello,
    I have been trying to follow the steps in your description, but when I try to create an app I get the page “Your account must be verified before you can take this action. Please verify your account by adding your ….”
    When I put the code specified on a page (internal), the link takes me to a credit card info page. Does this code need to go on a public page? Why does it take me to a payments page? To create an app is free, right?
    Thanks

  479. Steven Robert on Fri, 18th Mar 2011 2:14 am
  480. @Michael ,it is free, before that verify your phone number by entering the code that u will get from SMS.

  481. Pankaj on Tue, 22nd Mar 2011 7:28 am
  482. Hi,

    When we use https://login.facebook.com/code_gen.php?api_key=API_key&v=1.0

    whith own api key . it gives error “An error occurred. Please try again later.”

  483. Decorative Concrete on Wed, 23rd Mar 2011 2:38 am
  484. I’m just new in your topic. But exactly, I always had a bad time I posting in the wall.
    Your post could be my key to ease my problem. Thanks for sharing about it!

  485. John Wolf on Wed, 23rd Mar 2011 1:30 pm
  486. thank you for such a great, detailed tutorial — excellent!

    Some of the Facebook code has changed since you posted this, and I was getting an assortment of error messages from functions that didn’t exist in the libraries I had. I finally got a clean version of matching libs at:

    http://pearhub.org/get/facebook-0.1.0.tgz

    Now everything works as you described… except I have one problem…

    I need to post to an “organization” page but the comments are going to the regular user page (the administrator of the organization).

    Is there any way to post to the wall of an organization/company/etc instead of posting to the wall of the user who is that org’s admin?

    anybody?

    Thanks!

  487. Steven Robert on Sat, 26th Mar 2011 9:27 am
  488. @Pankaj, Many times FB gives same error try after sometime u will get it.

  489. Alan on Mon, 28th Mar 2011 5:35 am
  490. Hi Steven,
    I have tried your code but i am getting error while creating the token id sir. The error is “An error occurred. Please try again later”. Please help me to sort out this issue sir.

    Regards
    Alan.

  491. John Wolf on Wed, 30th Mar 2011 8:52 am
  492. UPDATE – I figured it out!!

    In order to post to a wall other than your own, you need to specify the target wall in the stream_publish transaction, like this…

    $facebook->api_client->stream_publish($message,null,null,$TARGET_PAGE_ID,$TARGET_PAGE_ID);

    …to publish to your own wall, use this shorter transaction…

    $facebook->api_client->stream_publish($message)

    …but if you really want to go all out and put pictures and links on a target wall, follow this formula…

    $message = “This is the blurb at the very top of the post”;
    $TEMP_IMAGE = “http://yourdomain.com/images/whatever.jpg”;
    $TEMP_URL = “http://yourdomain.com/something.html”;
    $TEMP_NAME = “Bold title to right of picture”;
    $TEMP_CAPTION = “Detail paragraph below bold title “;
    $attachment = array(
    ‘name’ => $TEMP_NAME,
    ‘href’ => $TEMP_URL,
    ‘caption’ => $TEMP_CAPTION,
    ‘description’ => ”,
    ‘media’ => array(array(
    ‘type’ => ‘image’,
    ‘src’ => $TEMP_IMAGE,
    ‘href’ => $TEMP_URL))
    );

    $action_links = array( array(‘text’ => $TEMP_NAME, ‘href’ => $TEMP_URL));

    $facebook->api_client->stream_publish($message,$attachment,$action_links,$FB_PAGE_ID,$FB_PAGE_ID)

    THANKS AGAIN TO EVERYONE !!!

  493. Majox on Sat, 2nd Apr 2011 7:22 pm
  494. Hi, i try this more than 3 times, but I still have a problem, i searching for solution, but I am not find it….

    I try this step by step, then I try it with this:

    Complet zip but still this error message:

    http://blog.theunical.com/wp-content/uploads/2010/01/fb_app.zip

    Fatal error: Class ‘Facebook’ not found in index.php

    Thank you for answer

    Majox

  495. Jeremy on Sun, 3rd Apr 2011 12:46 pm
  496. is it possible to add the PHP to a site that is using a localhost VIA wamp server?

    Currently I am at the step to get my unique token, however it keeps erroring out and I am thinking that it might be as a result of entering in a address of http://localhost/insertwebsitehostedbywampserverhere anyways if someone knows if this is possible let me know.

    Thanks,

  497. Steven Robert on Mon, 4th Apr 2011 2:31 am
  498. Yes @Jeremy it is possible even with ur local host

  499. Majox on Mon, 4th Apr 2011 10:23 am
  500. Hi, please can you help me? I sucessfully upload files (from http://blog.theunical.com/wp-content/uploads/2010/01/fb_app.zip ) to my server, but I still have erro in index.php with this message “Fatal error: Class ‘Facebook’ ” thank you again for answer Majox.

  501. baljeet on Tue, 5th Apr 2011 2:52 am
  502. Hi Steve, how are you?

    I’m doing a project and facing this obstacle for many days now.

    I have created a facebook app.
    http://apps.facebook.com/myamazingidea/
    The user can see his data after authorizing access to his account. How to i recognize who has authorized ?

    Please let me know which connect url should I use, what it will return, how will I compare the return user id with the session for logged in user so that my system will not ask same user to authenticate again and it will show data for that particular user.

  503. Eugin on Fri, 8th Apr 2011 10:24 am
  504. Hi, for two days I am trying to make this script… it\’s difficult, strnge thing… I got 1 post, but after it I got:
    Fatal error: Uncaught exception \’FacebookRestClientException\’ with message \’Incorrect signature\’ in /home/psaddonc/public_html/facebook-platform/php/facebookapi_php5_restlib.php:3025 Stack trace: #0 /home/psaddonc/public_html/facebook-platform/php/facebookapi_php5_restlib.php(916): FacebookRestClient->call_method(\’facebook.stream…\’, Array) #1 /home/psaddonc/public_html/add_news.php(29): FacebookRestClient->stream_publish(\’news http://www…\’) #2 {main} thrown in /home/psaddonc/public_html/facebook-platform/php/facebookapi_php5_restlib.php on line 3025

    don\’t understand why 1 message was posted and others no. Session key – can\’t get it, got a post without it, using this code:

    require_once(\’facebook-platform/php/facebook.php\’);

    $api_key = \”*–\”;
    $secret_key = \”–\”;
    $facebook = new Facebook ($api_key, $secret_key);
    $user = $facebook->require_login();

    $message = \’news http://www.mega.cl test\’;
    $has_permission = $facebook-> api_client-> users_hasAppPermission (publish_stream);

    //The user must give permission for your application publishes information on its wall.
    if ($has_permission)
    {
    $facebook->api_client->stream_publish($message);
    echo \”posted the message\”.$message.\”\”;
    }
    else{
    $address = \”http://www.facebook.com/connect/prompt_permissions.php?api_key =\”. $api_key. \”& v = 1.0 & next = http://www.facebook.com/connect/login_success.html?xxRESULTTOKENxx&display = popup & ext_perm = read_stream, publish_stream & enable_profile_selector = 1 & profile_selector_ids = \”. $user;

    //header ( \”location: $address\”);

    }

    can you help me please?

  505. SK Imdad on Wed, 13th Apr 2011 4:19 pm
  506. Sorry my previous post did not sho up in the list. if you have received it please ignore this.
    call_method(‘facebook.auth.getSession’,
    array(‘auth_token’ => $testtoken, ‘generate_session_secret’ => true));
    $facebook_infinite_session_key = $_SESSION['session_key']=$result['session_key'];
    }
    else
    {
    $facebook_infinite_session_key=$_SESSION['session_key'];
    }

    $facebook = new Facebook($FB_APIKEY, $FB_SECRET);
    $infinite_key_array = $facebook->api_client->auth_getSession($auth_token);
    print_r($infinite_key_array);

    $facebook = new Facebook($FB_APIKEY, $FB_SECRET);
    $infinite_key_array = $facebook->api_client->auth_getSession($auth_token);
    print_r($infinite_key_array);
    ?>

    1.This code did not printed anything. I think the session key is not generated. what’s wrong with this code?
    2. If we use the other way to generate the session key.( i.e. to follow the url to generate permanent session. ) every user have to follow that url and generate session once. The target page is not our App’s page so we can’t keep the session key in that way. If there is a way please tell me. If we have to keep user id with session then we have know the user id to get the session key. to get user id we need api call which needs session key. Isn’t it a deadlock?
    3. See, my intension is to create an app that simply when visited by user will prompt user for permission, if accepted automatically takes to a app’s page where he can publish a predefined (hard coded) message/caption, image, action links . Popups are hated.
    Please help me doing this.
    A super thanks in advance.

  507. Steven Robert on Wed, 13th Apr 2011 10:58 pm
  508. @SK Imdad Some times it gives error so try 4Step first then try to generate session key.

  509. Filipi on Wed, 11th May 2011 9:41 am
  510. Good morning Steve, sorry to my english.

    I can post status in the wall, but when use cron not work… Already try everything and cannot to use cron for automatize. Can be anything permission? if not use cron work!

    My code:

    api_client->session_key = FB_SESSION;

    $fetch = array(‘friends’ =>
    array(‘pattern’ => ‘.*’,
    ‘query’ => “select uid2 from friend where uid1={xxx}”));

    echo $facebook->api_client->admin_setAppProperties(array(‘preload_fql’ => json_encode($fetch)));

    $sql = $base ->query(‘SELECT * FROM wall WHERE DATE_FORMAT( data_agendada, “%H:%i” ) = DATE_FORMAT(“‘ . date(‘Y-m-d H:i:s’) . ‘”, “%H:%i”) ‘);

    while ($result = $base ->tupla($sql)) {

    echo $result ['text_facebook'].”";

    echo “sign in”;

    if ($facebook->api_client->stream_publish($resultado['text_faceboon].” Testing cron”))
    echo “Added on test FB Wall”;
    }
    } catch (Exception $e) {

    echo $e . “”;
    }
    ?>

  511. Filipi on Wed, 11th May 2011 11:50 am
  512. I’m trying to implement a code to post status on the facebook wall.
    It’s working when I directly post the message. However, I would like to use “Cron” to schedule the posts and already tried everything without success.
    Has anyone faced this problem? Can you help me with any tips?
    Is there another solution without using “Cron”?
    Thanks for your attention.

  513. Steven Robert on Wed, 11th May 2011 11:32 pm
  514. @Filipi Yes if you got permission the first time, then you can use it in cron.

  515. John Wolf on Fri, 13th May 2011 6:25 am
  516. SOLUTION TO: “An error occurred. Please try again later.” in Step-2

    Hey everyone! – first of all, a HUGE thanks to Steven for opening Pandora’s box and letting all of us share his mad FB skilz :)

    For everyone who encountered that annoying error in Step-2, there’s a quick and easy fix.

    1) download this PHP source:

    http://dl.dropbox.com/u/3681603/fb_kickstart.zip

    it includes a folder called fb_kickstart
    in it you’ll find: index.php (the kick starter)
    and another sub folder called \src that contains the oAuth 2.0 version of facebook.php and the fb_ca_chain_bundle.crt file.

    2) un-pack the contents to your desktop and then edit the index.php file changing the YOUR_APP_ID and YOUR_APP_SECRET values to the ones that go with your app.

    3) push the folder over to your HTML root on the server and run:

    http://YOURDOMAIN.COM/fb_kickstart/

    You’ll get a screen that asks you allow your app access to your personal FB credentials — (USE THE FIRST BUTTON AT THE TOP) — say Yes to allow access.

    Now, re-try Step-2 and it will work like a champ!

    Thanks again Steven!!!

  517. H on Mon, 16th May 2011 11:58 am
  518. Hi,
    I was wondering if you know a better way to revoke the extended permission (“publish_stream”). I am using Javascript SDK for publishing the post on Fb.
    There is method for revoke in their legeacy api but I am not too keen on using that I was wondering if you have bettter soltn.

    A great post it would have helped a lot of ppl.

    Thanks,
    H

  519. Atiq on Wed, 25th May 2011 2:16 am
  520. what to do with step 5 code, where to execute?? also confirmed me i got the session key in { ……………. } i got the right?

  521. Amedeo on Sat, 28th May 2011 3:11 am
  522. How to programmatically the token? pls help

  523. pratap on Tue, 31st May 2011 4:12 am
  524. hello
    after step one i got all keys and ids. but i c’nt generate token . means second step is creating problem.

  525. Troy on Wed, 1st Jun 2011 8:55 am
  526. Hi Steven,

    I got the following problem. When i try to execute the generatesession.key.php or any other php file that you used.. i end up with a Blank page. I have tryed everything..

    What could be the problem to this? Any ideas?

  527. Steven Robert on Wed, 1st Jun 2011 10:09 pm
  528. @Troy did u tried using FB library from this post?

  529. bharat on Thu, 9th Jun 2011 3:42 am
  530. Hi steven, thank for your link….
    I have followed your code very smart.

    My question is I’ve create a one facebook application.
    But how to create code allow Link for other person, because my application not allow link applicable and not add friend application.
    How to solve the issue.
    and
    $fetch = array(‘friends’ =>
    array(‘pattern’ => ‘.*’,

    How to change pattern or only one friend select and publish only one friend wall ?

    Please check following link suggest me.

    my application link : http://apps.facebook.com/autographbooks/

    Thanks & Regards
    Bharat.

  531. Malay on Fri, 10th Jun 2011 1:08 am
  532. Hi,
    Its very useful blog for all. Can I use your java api with J2ME Polish or simple J2ME code ?

    http://blog.theunical.com/facebook-integration/facebook-java-api-example-to-publish-on-wall/

    Thanks,
    Malay

  533. Steven Robert on Fri, 10th Jun 2011 10:50 pm
  534. @Malay you are always welcome

  535. Milos on Wed, 15th Jun 2011 7:50 am
  536. Keep in mind that “stream.publish” is not fully supported aymore, it´s now in “Legacy REST API” – so if you are building a new face-app you shouldn’t use this function. Use instead Graph API. Hope this helps somebody. Happy coding!

  537. Lucijan on Wed, 15th Jun 2011 5:35 pm
  538. this is great! btw can i post a link that will automatically fetch the picture and the title like sharing a fb page?

  539. John on Fri, 17th Jun 2011 3:24 am
  540. first i have to thank Steven Robert. cox im using this method to update my fb page. now i want to ask that will this method (Stream Publish) works on posting into comments/replying or others profile or in other pages. i mean posting in others profile via my app?

  541. Steven Robert on Fri, 17th Jun 2011 10:45 pm
  542. yes @John , it works

  543. Roufaa on Wed, 22nd Jun 2011 11:51 pm
  544. Hii ! I want to create an app that shares on any user’s wall who accepts the permission dialog ! i did it well when it was with ‘FBML’ but i’m facing difficulties with ‘iframe’ ! This was my index.php when i was using FBML :

    $app_id,
    ‘secret’ => $app_secret,
    ‘cookie’ => true,));
    $session = $src->getSession();
    $fbme = null;
    if ($session) {
    try {
    $fbme = $src->api(‘/me?fields=id,first_name,last_name,email’);
    } catch (FacebookApiException $e) {
    error_log($e);
    }
    }
    if (!$fbme) {
    $login_url = $src->getLoginUrl(array(‘canvas’ => 1,
    ‘fbconnect’ => 0,
    ‘req_perms’ => ‘publish_stream’,
    ‘next’ => $app_canvas,
    ‘cancel_url’ => ‘http://apps.facebook.com/raycharles/’ ));
    echo ”;
    }
    $user_id = $fbme[id];
    $user_first_name = $fbme[first_name];
    $token = $session[access_token];
    $message = “”;
    $link = “”;
    $picture = “”;
    $name = “”;
    $caption = “$user_first_name a installé ce pack”;
    $description = “incroyable !!”;
    $post = “message=$message&access_token=$token&link=$link&picture=$picture&name=$name&caption=$caption&description=$description”;

    $curl = curl_init(“https://graph.facebook.com/me/feed”);
    curl_setopt($curl,CURLOPT_POST, true);
    curl_setopt($curl,CURLOPT_POSTFIELDS,$post);
    curl_exec($curl);
    curl_close($curl);
    ?>

    Just to give u an idea about what i’m talking about !

    This code doesn’t work anymore ! Please help me ! how can i do the same thing with iframe ! thanks

  545. John on Sat, 25th Jun 2011 10:59 pm
  546. I need to send my facebook users to my wall from my welcome page.
    I have the code to determine if they are a fan. If they are not a fan, I ask
    them to become a fan by liking me. Once they do, I want to direct them
    to my wall automatically. What is the code to perform just this?
    Seems simple but I can’t seem to find any examples.

  547. Chirag on Wed, 6th Jul 2011 4:05 pm
  548. Nice tutorial..
    I have not tried the given scripts yet. Could you please tell what the following part does?
    $fetch = array(‘friends’ =>
    array(‘pattern’ => ‘.*’,
    ‘query’ => “select uid2 from friend where uid1={$user}”));
    echo $facebook->api_client->admin_setAppProperties(array(‘preload_fql’ => json_encode($fetch)));

    What I require is to make the user able to select one of his friends so I may get friend_id. I hope am clear. It d be great if you could help.
    Thanks

  549. กเก้ด on Sat, 9th Jul 2011 6:46 am
  550. I hav error.

    Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/paghama/domains/alumni.comswu.com/public_html/tw.php:11) in /home/paghama/domains/alumni.comswu.com/public_html/facebook.php on line 37

    Fatal error: Call to undefined method stdClass::admin_setAppProperties() in /home/paghama/domains/alumni.comswu.com/public_html/tw.php on line 25

    Can u help me

  551. John on Sat, 9th Jul 2011 12:50 pm
  552. To send users to another website or to an app on your facebook page, you can use the PHP code as described here:
    http://php.about.com/od/learnphp/ht/phpredirection.htm.
    Now on your facebook welcome page, once you determine they are a fan, use this code to send them to your app. However, I do not know the code how to send a user to the wall, just an app. That would be useful to know as well.

  553. Obed on Sat, 9th Jul 2011 1:14 pm
  554. Were do i find the
    YOUR_SESSION_key

    define(‘FB_SESSION’, ‘YOUR_SESSION_key’);

    I cant fin it

  555. ketan on Wed, 27th Jul 2011 2:02 am
  556. followed the steps and it works. thanks

  557. allan rivera on Tue, 2nd Aug 2011 12:24 am
  558. Please anyone here can give an idea on how can I generate the TOKEN ID and SESSION KEY dynamically without typing the URL?

  559. Novrizal on Thu, 25th Aug 2011 6:43 pm
  560. I dont understand on steps 3
    After i make a php script on step 3.
    Then, what must i do with this script ?
    Save ? other name xxxx.php ?

  561. Steven Wall on Thu, 25th Aug 2011 11:03 pm
  562. Yes you can save that to a .php file

  563. aaron on Fri, 9th Sep 2011 10:31 am
  564. steven , if i put my URL in my app as “http://127.0.0.1/index.php” , can it work? because my website is localhost

  565. Steven Wall on Sun, 11th Sep 2011 1:33 am
  566. @arron, Its better if you host on a public domain , not localhost.

  567. sanjay on Wed, 21st Sep 2011 12:25 am
  568. HI Steven ,
    I have created a new application on FB.I can access it from new Tab ,but my friends or anyone on FB cannot access it…They cannot get it.I have to publish or submit my newly created Apps?

  569. Steven Wall on Wed, 21st Sep 2011 11:01 pm
  570. @sanjay Your friends should be able to see it , did u changed any settings on ur FB? To publish on their walls they need to give permission.

  571. Mithun on Mon, 26th Sep 2011 5:28 am
  572. Hi steven

    I want to post on facebook wall from my website i have also code which i have downloaded from http://blog.theunical.com/wp-content/uploads/2010/01/fb_app.zip

    but after applying
    facebook_api_key, facebook_api_secret and testtoken as access token i am still getting the following errors

    Fatal error: Uncaught exception ‘FacebookRestClientException’ with message ‘The parameter auth_token is required’ in E:\DEV4.HCS\testingcode\facebook_wall\facebook-platform\php\facebookapi_php5_restlib.php:3025 Stack trace: #0 E:\DEV4.HCS\testingcode\facebook_wall\facebook-platform\php\facebookapi_php5_restlib.php(300): FacebookRestClient->call_method(‘facebook.auth.g…’, Array) #1 E:\DEV4.HCS\testingcode\facebook_wall\index.php(6): FacebookRestClient->auth_getSession(NULL) #2 {main} thrown in E:\DEV4.HCS\testingcode\facebook_wall\facebook-platform\php\facebookapi_php5_restlib.php on line 3025

    can i have solution for this

    thank you very much for providing such helping platform.

    thanks again
    mit

  573. Steven Wall on Mon, 26th Sep 2011 11:04 pm
  574. @Mit are u trying from ur local machine? Try from a public IP

  575. Vikash Sharma on Thu, 29th Sep 2011 8:36 am
  576. Hi Steven,

    Thanks for such a great post. We are also doing the same task for one of our website. We are able to fetch the User details as well as User’s Friend List. User’s friend list means the details of friends and relatives, whom user has added in his Facebook account.

    But we are facing problems In:
    1. Getting the email Id and Mobile number of User’s Friend.
    2. Posting a dynamic message on the wall of multiple friend’s (User’s Friend). We do not have the email id of the friends but we have a unique Facebook id of all these friends of the user. We want to post a message on friend’s wall using the same id.

    The functionality is like given below:

    User will login to our website and will select multiple friends/relatives from his friend list that we had fetched from Facebook. Then he will write a message for all his selected friends.
    When he will click on submit button, we want to post a message like, has sent a message to to invite him to meet at . Please click the link to view more details about the user.

    This message should post on the wall of all the selected friends. We have and stored in database.

  577. Mit on Sat, 10th Dec 2011 8:19 am
  578. Hi Steven

    Mit Here again

    i have to make post on my Facebook profile from my website and some how managed to make post getting login in to face book but now i am facing problem is that if logout from Facebook my website login page cannot maintain my session .once i am logout it gives me message

    stdClass Object ( [error] => stdClass Object ( [message] => Error validating access token: Session has expired at unix time 1323518400. The current unix time is 1323519398. [type] => OAuthException ) )

    even if again login from direclty from faceboo it shows me i am already logout

    Here is the path

    http://clients.teamevolution.com.au/bym/mithun_facebook/index.php

    we can also post a message from

    after login

    here is the code

    ===============================
    $_SESSION['accesstoken'], ‘message’=>$_REQUEST['txt'] );
    $url = ‘https://graph.facebook.com/’.$currentuser->facebookid.’/feed’;
    $ch = curl_init();
    curl_setopt_array($ch, array(
    CURLOPT_URL => $url,
    CURLOPT_POSTFIELDS => $params,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_VERBOSE => true
    ));
    $result = curl_exec($ch);
    curl_close($ch);
    echo ‘Post successfully in Facebook.’;
    }

    $curl = curl_init(‘https://graph.facebook.com/me?fields=id,name,bio&access_token=’.$_SESSION['accesstoken']);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
    $result = curl_exec($curl);
    $fbuid = json_decode($result);
    print_r($fbuid);
    $user_id=$fbuid->id;
    if(is_null($user_id))
    {$_SESSION['live']=”No”;}
    else
    {$_SESSION['live']=”YES”;}

    echo ‘Your name:‘.$fbuid->name.’‘;
    echo ‘About you:‘.$fbuid->bio.’‘;
    echo ‘Ur Profile link:id.’” target=”_blank”>Click here‘;
    echo ‘Write something to post it in your Facebook wall’;
    echo ”;
    echo ”;
    echo ”;
    echo ”;
    echo ‘Submit’;
    echo ”;
    echo ”;

    }
    elseif($_REQUEST['code'])
    {
    //getting access token from the retrieved code.
    // change $returnurl in the next line
    $returnurl = “http://clients.teamevolution.com.au/bym/mithun_facebook/index.php”;
    $url = ‘https://graph.facebook.com/oauth/access_token?client_id=’.$appid.’&redirect_uri=’.$returnurl.’&client_secret=’.$key.’&code=’.$_REQUEST['code'];
    $ch = curl_init();
    curl_setopt_array($ch, array(
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_VERBOSE => true
    ));
    $result = curl_exec($ch);
    curl_close($ch);
    $accesstoken = explode(‘&’, $result);
    $accesstoken = explode(‘=’, $accesstoken['0']);
    //setting the accesstoken in a session to use it later.
    $_SESSION['accesstoken'] = $accesstoken = $accesstoken['1'];
    //following script to refresh the page after session is set
    echo ‘window.location.reload();’;
    }
    else
    {
    $returnurl = “http://clients.teamevolution.com.au/bym/mithun_facebook/index.php”;
    $url = “https://graph.facebook.com/oauth/authorize?”;
    $url .= “client_id=”.$appid.”&”;
    $url .= “redirect_uri=”.$returnurl.”&”;
    $url .= “scope=publish_stream,email,user_about_me”;
    $url .= “&display=popup”;
    echo ‘Connect to Facebook‘;

    }

    ?>

  579. Nischal Tiwari on Fri, 10th Feb 2012 6:03 am
  580. Hi Stevan,

    I tried your code and it worked for me but i have few problem regarding posting. Actually, Whenever I try to logged in with different users, the wallpost goes with same name off APPS admin. [Nischal Tiwari] like that.

    I have a login/logout feature that means who ever sign in, i want to see their name in the wallpost instead of Apps admin. Is that possible ?

    Let me know

  581. Jose on Tue, 28th Feb 2012 6:00 am
  582. Hi Steven,

    I done these 5 steps and it is working perfectly into the profile wall. But i want it post to page wall. i have seen that you mentioned regarding target id. I am not able to find where i can do that. I am looking forward to your reply.

    Thanks

  583. Sanjay Soral on Tue, 28th Feb 2012 6:51 am
  584. Hi,

    I am creating a ASP.NET application and i want to do same thing for ASP.NET, here the Example is explained in PHP. SO can you help me how to implement in ASP.NET(In Both C#,VB).

    Thanks
    Sanjay Soral

  585. Jim on Fri, 9th Mar 2012 5:15 pm
  586. First, thank you so much. I’ve been searching and banging my head against the wall for days trying to get this kind of thing to work.

    I did exactly what you said and it worked like a charm.

    Now to implement it on my site. I’m going to post the idea here in case you can help figure it out before I get to it later.

    I’m using the facebook registration plugin for registration, then saving their fb id in a database. Then I have a database of quotes and I want to be able to have them click “share” and have it post to their wall. They have to be logged on to fb and registered with the site in order to even see the quotes.

    What I have to figure out is what to do with the Step 2 and 3 stuff there. Does each user have to physically copy the code from step 2, or can I access it another way? Do I need to get the session key for each user in Step 3 only once, then save it in my database to use when that particular user shares?

    Off to play. I’m just thrilled you’ve given me a starting point. When I know it “CAN” work, I’m much better at finding out how to make it work.

  587. Kevin on Tue, 8th May 2012 3:32 am
  588. Hi Steven,
    I did the all steps. But I don’t know how to run the php code or what should I use to run the php code. Could you teach me? Thank you so much.

  589. PARUL on Fri, 11th May 2012 9:20 am
  590. Hello…i am following your 5 steps and built up a application and its going perfectly but after 2-3 months a checked then i got a error that your session was expired ot too old ,so for this i create new Token and Session…..can any one give me solution for that???I have to use that session all the time because i created dynamic application and i can’t create session each time.

    Please reply ASAP

  591. sunil on Wed, 16th May 2012 6:50 am
  592. I am getting this error, plz help me.

    post on wall

    exception ‘FacebookRestClientException’ with message ‘Incorrect signature’ in D:\xampp\htdocs\wibiya\facebookapi_php5_restlib.php:3026 Stack trace: #0 D:\xampp\htdocs\wibiya\facebookapi_php5_restlib.php(2883): FacebookRestClient->call_method(‘facebook.admin….’, Array) #1 D:\xampp\htdocs\wibiya\test4.php(27): FacebookRestClient->admin_setAppProperties(Array) #2 {main}

  593. R on Thu, 5th Jul 2012 4:07 am
  594. I have created session key . how to use session key ?….. for automatically login and how to read news feed……..

  595. R on Thu, 5th Jul 2012 4:11 am
  596. I have successfully completed four steps i got session key now i am unable to automatically login what to do? how to use session key . and how to read news feed……

  597. Riya on Thu, 5th Jul 2012 6:49 am
  598. I am using the library downloaded from this link . i have successfully completed 4 steps and got session key but i am not able successfully use this session key ? how to use session key please give me some examples . iam not able to login successfully login using this key every time when i run my program facebook login screen comes . there is any need of ui each time we run our application . how to read news feed .

    it’s very urgent please reply as soon as possible.

  599. vanishri on Thu, 26th Jul 2012 7:47 am
  600. hi please let us know what exactly is the “$user” variable in the query select uid2 from friend where uid1={$user} ,

  601. Flights to Zante on Tue, 7th Aug 2012 9:25 am
  602. Excellеnt pieces. Keеp writing such kіnd οf infoгmatіon
    on уour page. Іm геally impreѕsed by it.

    Thаnks for sharing your thoughts on facebook integration.
    Regarԁs

  603. ashok on Thu, 11th Oct 2012 8:24 am
  604. Hi,

    I have obtained the one time session as suggested above add set the Permission for wall as suggested but when I see the step5 Publishing the message on Facebook Wall, and followed it I got some errors.

    When I see the PHP SDK there is no code for the function $facebook->api_client->admin_setAppProperties and event there is no code for $facebook->api_client->session_key = FB_SESSION;

    Please suggest how it can be done with the latest PHP SDK code.

Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!





*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Subscribe without commenting