Canvas callback page and fb_* variables passed
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:
- The user is not logged in to Facebook.
- The user is logged in to Facebook, but has not “granted access” to your application.
- 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..(:))
Popularity: 2% [?]
“Canvas callback page and fb_* variables passed”