Fools Garden
mY dEaR diARy!!!

Canvas callback page and fb_* variables passed

August 8th 2009 in Facebook

The callback page is the page Facebook calls whenever it needs to notify your app of something or get the content of the canvas page for your app.

Canvas Pages & Callback Pages

Note that the user can be either logged into facebook or not, and even if a user is logged in, he/she might have authorized the app, or not. As an app programmer, you can allow the user to authorize later by holding back on the $facebook->require_login() call. So, technically, three states are possible:

  1. The user is not logged in to Facebook.
  2. The user is logged in to Facebook, but has not “granted access” to your application.
  3. The user is logged in to Facebook, and has “granted access” to your application.

The variables passed to the callback page when served on the canvas page in these three states correspondingly are:

The user is not logged in to Facebook.

  • fb_sig_in_canvas => 1 [1/0, is this a request for a canvas page?]
  • fb_sig_request_method => GET
  • fb_sig_position_fix => 1
  • fb_sig_locale => en_US
  • fb_sig_in_new_facebook => 1
  • fb_sig_time => 124….34.8315
  • fb_sig_logged_out_facebook => 1
  • fb_sig_added => 0
  • fb_sig_api_key => a8..API_KEY_OF_APP…b2
  • fb_sig_app_id => 7..THE_APP_ID..9
  • fb_sig => 98…SOME_RANDOM_SIG…19

Live Example : Visit this link without logging into facebook and check the variables passed :

http://apps.facebook.com/manishalexin/blog/canvas_unsigned.php

The user is logged in to Facebook, but has not “granted access” to your application.

  • fb_sig_in_canvas => 1 [1/0, is this a request for a canvas page?]
  • fb_sig_request_method => GET
  • fb_sig_position_fix => 1
  • fb_sig_locale => en_US
  • fb_sig_in_new_facebook => 1
  • fb_sig_time => 123….56.5721
  • fb_sig_added => 0
  • fb_sig_api_key => a8..API_KEY_OF_APP…b2
  • fb_sig_app_id => 7..THE_APP_ID..9
  • fb_sig => 98…SOME_RANDOM_SIG…19

Live Example : Visit this link without logging into facebook and check the variables passed :

http://apps.facebook.com/manishalexin/blog/canvas_signed.php

(First Login to facebook and then go this example to see the diffrence in variables..)

The user is logged in to Facebook, and has “granted access” to your application.

  • fb_sig_in_canvas => 1 [1/0, is this a request for a canvas page?]
  • fb_sig_request_method => GET
  • fb_sig_friends => here, will, be, a, comma, separated, list, of, userids, of, the, authorizing, user
  • fb_sig_position_fix => 1
  • fb_sig_locale => en_US
  • fb_sig_in_new_facebook => 1
  • fb_sig_time => 12….72.9749
  • fb_sig_added => 1
  • fb_sig_profile_update_time => 12…95
  • fb_sig_expires => 12….00 [is 0 if the session key contained in fb_sig_session_key never expires]
  • fb_sig_user => USERID_OF_AUTHORING_USER..2101
  • fb_sig_session_key => 2.2 …SESSION_KEY….2101
  • fb_sig_ext_perms => auto_publish_recent_activity
  • fb_sig_api_key => a8..API_KEY_OF_APP…b2
  • fb_sig_app_id => 7..THE_APP_ID..9
  • fb_sig => 98…SOME_RANDOM_SIG…19

Live Example : Visit this link without logging into facebook and check the variables passed :

http://apps.facebook.com/manishalexin/blog/canvas_signed_granted.php

When any user installs your app for the first time, the following parameters are passed to your callback page via GET:

  • installed=1
  • auth_token=(some value)

These variables can be used to control various objects in your program..!! I will let you know hoe to effectively use these variables in your program.  Stay tuned..(:))

sdfkjsdfkhslfhiehsl

Popularity: 9% [?]

You might also like Like :


One comment to...
“Canvas callback page and fb_* variables passed”

[...] This just uses a fb:name to recive your name and then display it. This is an example of signed canvas. You might hav to login to view your application [...]




required



required - won't be displayed


Your Comment:

:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!:

Why ask?

Continuing on my “Settings for application” tab dsecription..in which i have already described in detail the Canvas and Profiles tab and Basic and Authentication tab.

Settings : Connect

Facebook Connect Settings
Connect URL
Your Connect site’s main URL.
Facebook Connect Logo [...]

Previous Entry


Okay to create a new aplication on facebook, we will begin with developing the most basic application that ever be..!! This is just to realize some basic concepts on viewing facebook application on canvas page and other minor details.

Project : Hello world

Required : Web space(where you can host your application), BAsic knowledge of PHP and [...]

Next Entry


 
August 2009
M T W T F S S
« Jul   Sep »
 12
3456789
10111213141516
17181920212223
24252627282930
31  
Loading..