Build 10 classic Flash games and learn game development along the way with this ultra-fast paced game development course.

If you love this blog, this is the book for you.

Buy the book

Get the source code of 12 commercial Flash games, which have been loaded more than 50 million times!

Learn from real world successful examples.

Get it now

Box2D for Flash Games teaches you how to make Flash physics games from scratch with the most advanced features.

Create the new Flash game smashing hit.

Buy the book

Create a Facebook application like “Friend interview” – Step 3

Here we go with the 3rd step. In this tutorial you will learn how to publish a full featured feed post to your friends’ wall, and to handle “umlauts” characters like “äöü” for the pleasure of our German readers, and for every user who has friends whose names contain special characters.

This is the kind of feed you are going to publish:

And this is the link of the application, just in case you want to have a look: About you Facebook application

The code is almost similar to the one we used in step 2:

Using proper html tags such as http-equiv at line 38 allow us to properly render special characters, while the key of this post is line 20, where we pass a lot more information than in step 2.

Let’s see it in detail:

access_token: it’s the access token required to publish on friends’ wall. Its value must be

message: it’s the message which will appear next to your name. I used

because I wanted my friend to see “Emanuele Feronato just answered a question about you:”. I also used urlencode although it’s useless in this case, just not to forget to encode the string should I change it in the near future with another string with some special characters.

picture: the absolute URL of the picture to display on the left of your post.

name: it’s the name of the link you are publishing in the feed. This is where we will place the question.

link: it’s the link attached to the picture and the name. You may want to use the URL of the application itself.

caption: the caption of the link, placed just under the link itself. Don’t write anything important here as it won’t be noticed that much since the blue color of the link grabs almost all attention. Perfect to write something like “and the answer is…”

description: it’s the description of the link and it’s the longest text you can enter. We’ll place the answer there.

actions: you can also add a custom action to the action footer of the post (where you can find “Like”, “Comment”, and so on). Actions should be added as a JSON list containing “name” and “link”

And here you, go, have a try with the application: About you Facebook application.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 3.80 out of 5)
Loading ... Loading ...
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 24 comments

  1. Kyle

    on November 24, 2010 at 8:42 pm

    I have really liked this series about the facebook app. I really appreciate it.

    Is there are real difference between using curl to post to the users wall or using the graph api post?

  2. Michael Bochniak

    on November 24, 2010 at 8:58 pm

    Thank you! Great Tutorial that really works!

  3. Callum

    on November 24, 2010 at 10:56 pm

    @Kyle, you need to use cURL to post with the Graph API. This is the Graph API

  4. hadadjus

    on November 25, 2010 at 7:15 am

    think you so much , i liked this tutorial but please can you post how can”i make a list of question ? a question by user
    and how can i choose friend to ansower more question ?

  5. Michael Bochniak

    on November 26, 2010 at 1:05 am

    Hi there! I noticed a small problem. You use following code

    For german users they use another VALUE like “Veröffentlichen” with “umlauts”.
    I made it otherwise i asked for a hidden value

    and it still works. but the other button would do the same, so i programmed it

    but the problem with reload is…when someone typed a message previously and then wants to skip the next question the browser wants to load the $_POST data again… is there another way without 2 submit buttons in the form??

  6. Michael Bochniak

    on November 26, 2010 at 1:06 am

    nice…the html tag doesn't work -.-

  7. Danielo

    on November 29, 2010 at 6:29 pm

    Thx Emanuelle!
    I made it :D
    http://apps.facebook.com/the_sheperd/

  8. SSH

    on December 7, 2010 at 3:00 pm

    How to use action link in ‘POST’ graph api using fbconnect sdk(iphone)

  9. Jorgen

    on December 11, 2010 at 3:42 am

    My app wont post. help?

  10. Jorgen

    on December 11, 2010 at 7:14 pm

    This code is broken
    Can someone please fix it?

  11. Jorgen

    on December 11, 2010 at 8:36 pm

    Sorry for posting 3 times in a row, but Your app posts the right way, but mine doesn’t post. What are the settings that you have for your app or did you change the code. Thank You!

  12. hadadjus

    on December 28, 2010 at 8:34 am

    please ansowr me ; i neet your help

  13. Nalc

    on January 23, 2011 at 9:47 pm

    So far so good! I made some changes and managed to get a random question! There is only one problem is that whenever I enter the application always enjoyed the phrase forward for permission, there is no way around this? And I have another problem, Adsense does not appear in IE. Why?

  14. nithin

    on February 4, 2011 at 4:25 pm

    hey emanuele, nithin here :)
    this code is not posting on friends wall.
    please help, please please

  15. Kasper

    on February 17, 2011 at 4:31 am

    Code is not working. It post only on first time a user authorizes it, and not after that.

    Somehow it is losing the $session…

  16. Kasper

    on February 17, 2011 at 7:53 am

    I have found where the issue is:

    AFTER the first failed attempt to post, it works. But never on the first try.

  17. Denise

    on March 13, 2011 at 4:54 am

    Yes, I also noticed this problem – so how to fix it? Emanuele please help :-)

  18. Bill

    on March 30, 2011 at 4:43 pm

    $session will continually be lost and refound if using IE and not using proper P3P header. Make sure that you incorporate that into your appy :).

  19. Johny

    on April 21, 2011 at 5:10 am

    Not working, don’t bother.
    Author seems to have abandoned this.

  20. John

    on April 26, 2011 at 3:11 am

    @Bill don’t say bullshit just for the sake of saying something that would make you look smart. What you are referring to only affects ie6. What’s is wrong with this code is much more complex.

  21. gecko

    on April 26, 2011 at 5:23 pm

    really simple facebook apps.
    I love this series, make more facebook apps tutorial series please..

  22. steven

    on May 22, 2011 at 2:00 pm

    tell me is possible post on the wall of all my friends?
    i mean no one by one
    all of them?

    i hope you can help me with that
    sorry i dont speak english very good i hope you understand me and help me
    thanks

  23. pedro

    on November 21, 2011 at 2:29 am

    SHAME!

    Facebook seemed to have changed everything since 2010
    and I am getting an error that
    $Facebook->getSession()
    no longer exists ??

    [21-Nov-2011 00:25:00] PHP Fatal error: Call to undefined method Facebook::getSession() in /home/mbanorg/public_html/fb/friendstate/index.php on line 7

  24. sid

    on July 16, 2012 at 5:11 pm

    App is working nicely but not being posted on friendz wall ?
    what should i do plz guide mee…….