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'].

20 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 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
  9. 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
  10. 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
  11. Thank you for sharing this article, it is great info provide me. visit best leading
    Facebook app development companies

    ReplyDelete
  12. How To Contact Blockchain Support Number related to Technical problems

    Blockchain has different choices, different applications, and various techni glitches in addition. Every one of the mistakes will cause botches if it's not mounted on schedule. you'll dial Blockchain Support Number +1(856) 462-1192and report your inquiries to the mind blowing and rehearsed pros in an exceptionally explained way. they will investigate your issues absolutely and proffers ideal and convenient cures in most minimal time. basically profit their choice administrations to clear or resolve your questions and glitches. more detail visit here: https://www.thecustomercentre.com/webexchanges/blockchain-support-number/

    ReplyDelete
  13. Is your blockchain bitcoin withdrawal transaction pending? Are you unaware of the methods and techniques to deal with this error? If yes, you can dial blockchain toll-free number which is all the time working and users can contact anytime to get rid of the issues. The team is always there to help you out from every difficult situation. With the experts, you don’t have to worry and you can get fast and pertinent solutions in no time. The team is always punctual and ready to erase all sort of problems that occur and disturb the user’s work.+1-888-670-6949 bitcoin Support Number

    blockchain Number
    blockchain Support Number
    blockchain Support phone Number
    blockchain phone Number
    blockchain Customer Support Number
    blockchain Customer Service Number
    blockchain Customer care Number
    blockchain Support phone Number
    blockchain Support Number
    blockchain Toll Free
    blockchain help desk
    blockchain wallet support phone number
    blockchain phone support

    https://www.cryptocurrencyphonesupport.com/

    ReplyDelete
  14. Website Designing Company in Gorakhpur Big Aquatic

    ReplyDelete
  15. Great blog with lots of useful information and we offers you best eCommerce web design Dubai UAE.

    ReplyDelete