Tuesday, 22 March 2011

Facebook fan page: pass parameter to the application via url

Some times while developing the application as page tab it is necessary to pass some parameters to the application. For example it is needed to determine what the page is requested or stuff like that. The Facebook documentation contains the description of the parameter app_data which can help to do it.

This parameter is a JSON string and is usually specified when the application needs to pass some data to itself. The example of the usage:
http://www.facebook.com/somedummypage?sk=app_xxsome
appcodexx&app_data=somedata
If this parameter is specified in url of the page tab on the server side of the application it will be available as a part of signed_request ($_REQUEST['signed_request']). So, in the example above this parameter will be available as $_REQUEST['signed_request']['app_data'].

24 comments:

  1. Hi .. i need 2 thins: pass a parameter to a page tab .. and i would like to do this fom an update. example: i will post "Apple acquires Facebook .. (a href=/pagetab?news_id=4243)Click here to see more(/a)" .. Is there to pass a parameter and customize the text link to the page tab .. look: i'm not customize text link to a external page .. its a simple page tab .. thanks!

    ReplyDelete
    Replies
    1. Hi, I'm not sure that I understand question. Do you mean that you need to customize link in update post? If so it is possible to define link for wall post using stream.publish method, you need to set your urlencoded link to parameter action_links. Description of all params is here: http://developers.facebook.com/docs/reference/rest/stream.publish/

      Delete
    2. sorry .. my english is very very bad, and i was so tired. yes, i need create a link, in update post, to a page tab.. but i need that this link be a text link, like "Apple acquires facebook" (example), and this link send to a page tab in my fan page, instead of show the entire link: http://facebook.com/myfanpage/mypagetab...

      Delete
    3. Actually I didn't manage to find a solution for insert html-link to wall post, facebook cuts all <a> tags and leaves only clean url. It's internal facebook behavior. And also it's impossible to insert any html tags into wall post. Sorry, I can't help you with this stuff :(

      Delete
  2. i don't wanna show: "Click in the below link: http://..." I wanna show a beauty text link :)

    ReplyDelete
  3. This is great. Thanks for sharing this one. Are you a Facebook Application Developer? Cause you know how to fix some problem like this. By the way, hope to see more post of you regarding this.

    ReplyDelete
  4. Cool guide.Thanks for sharing a very detailed steps,it's so nice blog post...
    Facebook Applications Starting $39.99 ONLY!

    ReplyDelete
  5. Hello, your blog is nice. Can you tell me how to include app_data in page tab url?

    ReplyDelete
    Replies
    1. Hi, url should look like http://www.facebook.com/Your-page?sk=app_YOU-APP-ID&app_data=some-value

      Than you can fetch app_data variable from signedRequest in your server side code. Hope, this is helpful.

      Delete
  6. Good one. Nice to read your blog. A well-known and highly effective open-source, platform like Drupal is always amazing to the designers and the companies as well.
    web development

    ReplyDelete
  7. How this is possible using javascript SDK?

    ReplyDelete
    Replies
    1. Do you mean how it is possible to fetch variables passed to the application via fb page url using JS SDK? If so... actually I don't know if it is possible to do. As usual I get variables from signed_request on the server side and then pass it to js. Don't see any other solutions for this.

      Delete
  8. Thanks for sharing this quality information with us. I really enjoyed reading.
    juegosjuegos.com | juegos de matar zombies | jogos do friv

    ReplyDelete
  9. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.
    Signature:
    i like play games friv online and play games2girls 2 online free and play game friv games and games 2 girls ! have fun!

    ReplyDelete
  10. This is also a very good post which I really enjoyed reading. It is not everyday that I have the possibility to see something like this.
    Signature:
    download free descargar whatsapp and download baixar whatsapp online and descargar whatsapp gratis , baixar whatsapp gratis

    ReplyDelete
  11. I found a lot of information here to create this actually best for all newbie here. Thank you for this information.
    Signature:
    download descargar facebook gratis para Android celular and download free descargar facebook apk and descargar facebook gratis , descarga facebook

    ReplyDelete
  12. I am happy to find this post very useful for me
    Signature:
    The place to play all unblocked games 77 online. Here you can find every blocked games such as: unblockedgames , unblocked games happy , unblocked games 77 , gmod

    ReplyDelete
  13. A great possibility for me and it was a superb knowledge to view this site. Very difficult to uncover these beneficial web page or web site. I have many devices and achieving proper picture of these worked well and energy continues to be seeing about this weblog. Often my own intend to make my personal site as well as my own enjoyment is growing due to this page. I we do hope you may well be more effective.
    happy wheels
    super mario bros
    pacman
    agario

    ReplyDelete
  14. I hope today can better yet, share permissions
    agario game is a multiplayer browser game in which players have to eat competitors or be eaten while striving to dominate the world of colorful cells. In agario game, you start off with a small circle and eat smaller static circles and other smaller players. Once you get big enough you will get addicted. With agar.io, you have an option to split your circle in two and throw one half at the other players with larger speed, in order to gain more mass. You have the option to play agario skins in a Free For All mode, where you play against everyone, or you can play in teams. Play agar io skins online game for free with your friends now!

    ReplyDelete
  15. I love all the posts, I really enjoyed, I would like more information about this, because it is very nice., Thanks for sharing.
    Signature:
    i like play happy wheels demo online and play happy wheels games full and zombie tsunami apk , retrica download , retrica apk , happy wheels 2 , agario

    ReplyDelete
  16. WhatsApp é um metodo perfeito para segurá-los contatos com os seus amigos que não tem de pagar mais nenhuma taxa. Cadastre-se agora whatsapp baixar - baixar whatsapp - baixar whatsapp gratis - whatsapp - whatsapp messenger - whatsapp baixar gratis - download whatsapp - baixar whatsapp

    ReplyDelete

  17. Fireboy and Watergirl arrived again to the temple in the forest. 2 players together can help them to find their way out.
    happy wheels | strike force heroes | tank trouble 2 | fireboy and watergirl |fireboyandwatergirl | fireboy and watergirl 2 | goodgame empire | slitherio | Tank trouble | happy wheels | Strike Force Heroes
    Log in to your account or sign up to create a new account
    gmail sign in | create a Gmail account

    ReplyDelete
  18. I was working and suddenly I visits your site frequently and recommended it to me to read also. Age Of War 2
    Big Farm | Slitherio
    Tank Trouble | Happy Wheels
    Goodgeme Empire | Slither.io

    ReplyDelete
  19. Thank you for sharing this article, it is great info provide me. visit best leading
    Facebook app development companies

    ReplyDelete