• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Traxo Presentation - Facebook Garage Dallas 09
 

Traxo Presentation - Facebook Garage Dallas 09

on

  • 2,243 views

Traxo Presentation - Facebook Garage Dallas 09

Traxo Presentation - Facebook Garage Dallas 09

Statistics

Views

Total Views
2,243
Views on SlideShare
2,237
Embed Views
6

Actions

Likes
1
Downloads
0
Comments
0

1 Embed 6

http://www.slideshare.net 6

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Traxo Presentation - Facebook Garage Dallas 09 Traxo Presentation - Facebook Garage Dallas 09 Presentation Transcript

    • how many of these 10 travel sites do you use? multiple usernames, passwords, confirmation emails, etc. different systems and formats 10 of 10,000+ travel sites worldwide. 6/26/2009 Page 2
    • B2B 3rd Party Apps Reservation & Partners Unlocks, Info locked Aggregates & in 10,000+ Structures websites Travel Data B2C Website Our ‘blackbox’ TripBuilder ® (Key IP) 6/26/2009 Page 3
    • on traxo.com, friends can: • share travel plans • seek travel advice • see travel matches . . . automatically
    • Why Facebook Connect? • travel is social • fb becoming de facto identity standard • unprecedented distribution • close to seamless social graph portability
    • 2009 fbFund Finalist
    • More on Layouts facebook_init.ctp • Included by Other Layouts (default.ctp) • Inserted Near the Footer
    • Integration Points – Connect Site • Connect Button • Facebook Icon • Profile Pictures • Invite Friends • Publish Actions
    • Integration Points - Facebook.com • App Canvas • Feed / Stream • Profile • Tabs
    • Configuring Your Application • From your Facebook Developer Account • API Key, App Secret, App ID • Connect URL – http://example.com/ • Canvas URL – http://apps.facebook.com/yourappname/
    • Configuring Your Application • Canvas Callback URL – http://example.com/connect/ • Post-Authorize Callback URL – http://example.com/connect/app_authorize • Post-Remove Callback URL – http://example.com/connect/app_remove
    • CakePHP Application Structure • app_controller.php • config/bootstrap.php • models/facebook.php • controllers/connect_controller.php • views/connect/ • views/layouts/ – facebook.ctp – facebook_init.ctp – facebook_loader.ctp • vendors/facebook
    • Installing Facebook PHP Libary • app/vendors • svn co URL facebook • app/vendors/facebook – facebook.php – facebookapi_php5_restlib.php – jsonwrapper/ http://wiki.developers.facebook.com/index.php/PHP URL: http://svn.facebook.com/svnroot/platform/clients/php/trunk
    • Facebook-Specific Layouts • app/views/layouts – facebook.ctp (Canvas Layout) – facebook_init.ctp – facbook_loader.ctp – CSS/JS • Use <link rel=”src”> • Append a Version Number
    • Configuring the Cake Install • app/config/bootstrap.php • Add Define statements: – FB_APP_ON – FB_APP_NAME – FB_APP_URLNAME – FB_APP_ID – FB_APP_SECRET – FB_API_KEY – FB_BUNDLE_ID_GENERIC
    • Local Database Tables • Map FB_UID to Local User Accounts • FB_id BIGINT • (Optional) Session_key VARCHAR(140) • Review Facebook Connect TOS for Storable Parameters.
    • xd_receiver.php • app/webroot/xd_receiver.php • http://example.com/xd_receiver.php • Use PHP to Handle SSL Switching <php if ( $SSL ) { ?> <script src="https://www.connect.facebook.com/js/api_lib/v0.4/ XdCommReceiver.js" type="text/javascript"></script> <?php }else{ ?> <script src="http://static.ak.connect.facebook.com/js/api_lib/ v0.4/XdCommReceiver.js" type="text/javascript"></script> <?php } ?>
    • app_controller.php • Parent Controller for All App Controllers • beforeFilter() – User login/logout status probably set here – Great place to check for Facebook users – Called before every controller action – Calls to • facebookInit() • facebookAuth()
    • app_controller.php • Protected function facebookInit() { App::import('Vendor', 'facebook/facebook'); $fb = new Facebook( FB_API_KEY, FB_APP_SECRET ); if ($loggedInFacebookId = $fb->get_loggedin_user()){ $this->loggedInFacebookId = $loggedInFacebookId; $this->set("loggedInFacebookId", $loggedInFacebookId); if ($fb->api_client->users_isAppUser($loggedInFacebookId) || $fb->api_client->added){ $this->isFacebookAppUser = true; } } }
    • app_controller.php • Protected function facebookAuth() { if (!FB_APP_ON) { return true; } if ($loggedInFacebookId) { // check for local mapping against FB user // if found, log them in with native methods }
    • Connect Controller • Central Location For All Facebook Connect Actions • Some Actions Will Be Receivers For Facebook POST'd Responses • Could Be Expanded To Other Services
    • Connect Controller • connect/app_authorize • connect/app_remove • connect/app_disconnect • connect/new_user • connect/existing_user • connect/connected • connect/canvas • connect/invite_friends • connect/invite • connect/post_invite
    • app_authorize • User Connects on Your Site • Post-Authorize Callback URL • Capture and Store FB_UID • No User Interface http://wiki.developers.facebook.com/index.php/Account_Linking http://wiki.developers.facebook.com/index.php/Post-Authorize_URL
    • app_remove • User Removes Your App From Within Facebook • Post-Remove Callback URL • Delete Local Mapping Records • No User Interface • New Feature: Account Reclamation http://wiki.developers.facebook.com/index.php/Post-Remove_URL
    • app_disconnect • Triggered by User Action on Your Site • Same as User Removing Your Application From Within Facebook. • Post-Remove Callback URL • No User Interface • Optional, But Recommended $fb->api_client-> auth_revokeAuthorization($fb_uid)
    • registerUsers / unregisterUsers • Creates / Removes Associations For Existing User Accounts • Called in Batches Initially / Periodically • Called For Each New User • No User Interface $fb->api_client-> connect_registerUsers(json_encode($accounts)); $fb->api_client- >connect_unregisterUsers(json_encode($accounts)); http://wiki.developers.facebook.com/index.php/Connect.registerUsers
    • new_user / existing_user • Users That Already Have Local Accounts Can Enter Their Credentials • On Submit – Existing User Accounts Mapped to Current FB_UID and Logged In – New Account Created and Mapped to Current FB_UID – connect_registerUsers Function is Called With Hash of Email Address
    • new_user / existing_user
    • connected
    • canvas • apps.facebook.com/yourappname • app/views/connect/canvas.ctp – Implements a Custom Cake Layout for Facebook
    • canvas
    • invite_friends • Facebook UI for Inviting Friends (FBML) – fb:request-form – fb:multi-friend-selector • Could Use Javascript / FBJS – FB.Connect.inviteConnectUsers • fb:request-form Action – connect/post_invite.php http://wiki.developers.facebook.com/index.php/Account_Linking
    • invite_friends // set the destination url for the invitation. $next = $this->Link-> url('/connect/invite?id='.$local_user_id); $this->set("app_add_url", $fb->get_add_url($next)); // Retrieve array of friends who've already authorized the app. $fql = 'SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1='.$this->loggedInFacebookId.') AND is_app_user = 1'; try { $_friends = $fb->api_client->fql_query($fql); } catch ( Exception $exception ) { }
    • invite_friends <fb:serverfbml style=”width:100%;”> <fb:fbml> <fb:request-form action="<?php echo $link->url('connect/post_invite')?>" ... content="Traxo connects travelers! Share your trips and see where your friends are traveling. <?php echo htmlentities("<fb:req-choice url="$app_add_url" label="Join Traxo"") ?>" > <fb:multi-friend-selector ... exclude_ids="<?php echo $friends; ?>" /> </fb:request-form> </fb:fbml> </fb:serverfbml>
    • invite_friends
    • post_invite • Called After User Selects and Submits invite_friends • Facebook POSTs Array of Invited Facebook UIDs • “Action” Parameter of invite_friends fb:request-form • No User Interface
    • invite • Destination Handler for Friend Invites • Application Specific • Facebook Will POST to this URL With Any Parameters Specified from invite_friends • No User Interface
    • Questions? ...Launching this Summer
    • More on Layouts facebook.ctp • Used for Any View to be Rendered Within Facebook(.com) • Stylesheets and Javascript – Cached Heavily (and Permanently) – Use <link rel=”src”> with version number – Limited tags – Parsed by Facebook Server http://wiki.developers.facebook.com/index.php/Include_files http://wiki.developers.facebook.com/index.php/Including_Stylesheets_From_PHP
    • More on Layouts facebook_init.ctp • Included by Other Layouts (default.ctp) • Inserted Near the Footer FB_RequireFeatures(["XFBML"], function() { FB.Facebook.init("<?php echo FB_API_KEY; ?>", "/xd_receiver.php"); FB.Facebook.get_sessionWaitable().waitUntilReady(function(session) { var is_now_logged_into_facebook = session ? true : false; if (is_now_logged_into_facebook != already_logged_into_facebook) { FB.Connect.ifUserConnected(fb_onlogin_ready); } FB.XFBML.Host.parseDomTree(); }); });
    • More on Layouts facebook_loader.ctp • Included by Other Layouts (default.ctp) • Inserted Near the Head Tag <?php if ( $SSL ){ ?> <script type="text/javascript" src="https://www.connect.facebook.com/js/api_lib/ v0.4/FeatureLoader.js.php"></script> <?php }else{ ?> <script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/ v0.4/FeatureLoader.js.php"></script> <?php } ?>