SlideShare une entreprise Scribd logo
1  sur  49
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 } ?>

Contenu connexe

Tendances

Developers and Designers: Make Your Website Visible In Search Engines
Developers and Designers: Make Your Website Visible In Search EnginesDevelopers and Designers: Make Your Website Visible In Search Engines
Developers and Designers: Make Your Website Visible In Search EnginesBeansBox Studio
 
7 fresh free downloadable design resources
7 fresh free downloadable design resources7 fresh free downloadable design resources
7 fresh free downloadable design resourcesDennis Michels
 
Rest experience-report
Rest experience-reportRest experience-report
Rest experience-reportJim Barritt
 
Social Design - ProSEO
Social Design - ProSEOSocial Design - ProSEO
Social Design - ProSEOMat Clayton
 
Ruby on rails, php expert
Ruby on rails, php expertRuby on rails, php expert
Ruby on rails, php expertrajgoyal
 
Building an interactive timeline from facebook photos
Building an interactive timeline from facebook photosBuilding an interactive timeline from facebook photos
Building an interactive timeline from facebook photosRakesh Rajan
 
Extreme Web Productivity with Spring Roo
Extreme Web Productivity with Spring RooExtreme Web Productivity with Spring Roo
Extreme Web Productivity with Spring RooStefan Schmidt
 
SEO Crash Course: Website Rebuild
SEO Crash Course: Website RebuildSEO Crash Course: Website Rebuild
SEO Crash Course: Website RebuildStoney deGeyter
 

Tendances (9)

Developers and Designers: Make Your Website Visible In Search Engines
Developers and Designers: Make Your Website Visible In Search EnginesDevelopers and Designers: Make Your Website Visible In Search Engines
Developers and Designers: Make Your Website Visible In Search Engines
 
7 fresh free downloadable design resources
7 fresh free downloadable design resources7 fresh free downloadable design resources
7 fresh free downloadable design resources
 
Rest experience-report
Rest experience-reportRest experience-report
Rest experience-report
 
Social Design - ProSEO
Social Design - ProSEOSocial Design - ProSEO
Social Design - ProSEO
 
Ruby on rails, php expert
Ruby on rails, php expertRuby on rails, php expert
Ruby on rails, php expert
 
Building an interactive timeline from facebook photos
Building an interactive timeline from facebook photosBuilding an interactive timeline from facebook photos
Building an interactive timeline from facebook photos
 
Extreme Web Productivity with Spring Roo
Extreme Web Productivity with Spring RooExtreme Web Productivity with Spring Roo
Extreme Web Productivity with Spring Roo
 
SEO Crash Course: Website Rebuild
SEO Crash Course: Website RebuildSEO Crash Course: Website Rebuild
SEO Crash Course: Website Rebuild
 
Resume
ResumeResume
Resume
 

En vedette

INTRODUCCIÓN A LA ECONOMÍA RODERICK RODRIGUEZ
INTRODUCCIÓN A LA ECONOMÍA RODERICK RODRIGUEZINTRODUCCIÓN A LA ECONOMÍA RODERICK RODRIGUEZ
INTRODUCCIÓN A LA ECONOMÍA RODERICK RODRIGUEZRodrigo Rofdriguez
 
Academic CV Jodi L Mathieu
Academic CV Jodi L MathieuAcademic CV Jodi L Mathieu
Academic CV Jodi L MathieuJodi Mathieu
 
Tipografia
TipografiaTipografia
TipografiaESPOL
 
MHS-Rads-Specification-Guide_JUNE-2015
MHS-Rads-Specification-Guide_JUNE-2015MHS-Rads-Specification-Guide_JUNE-2015
MHS-Rads-Specification-Guide_JUNE-2015Daniel Davis
 
Askozia und peoplefone - Webinar 2016, deutsch
Askozia und peoplefone - Webinar 2016, deutschAskozia und peoplefone - Webinar 2016, deutsch
Askozia und peoplefone - Webinar 2016, deutschAskozia
 
Ag nr. 8477 q cells monokristallin (1)
Ag nr. 8477 q cells monokristallin (1)Ag nr. 8477 q cells monokristallin (1)
Ag nr. 8477 q cells monokristallin (1)Ali Çetingül
 
How to improve your email productivity to be more effective at work
How to improve your email productivity to be more effective at workHow to improve your email productivity to be more effective at work
How to improve your email productivity to be more effective at workgmbudafonyhu
 
Adwords Seminar 3: PLAs - How to do and Optimise
Adwords Seminar 3: PLAs - How to do and OptimiseAdwords Seminar 3: PLAs - How to do and Optimise
Adwords Seminar 3: PLAs - How to do and Optimiseindiumonline
 
Tutorial de uso de Autentico Chalk Paint
Tutorial de uso de Autentico Chalk PaintTutorial de uso de Autentico Chalk Paint
Tutorial de uso de Autentico Chalk PaintArteSano
 
Roi email marketing - presentacion.ppt web - gastón zarlenga - go plus
Roi   email marketing - presentacion.ppt web - gastón zarlenga - go plusRoi   email marketing - presentacion.ppt web - gastón zarlenga - go plus
Roi email marketing - presentacion.ppt web - gastón zarlenga - go plusDoppler
 
Regalos VIP 2013 - Fin de año
Regalos VIP 2013 - Fin de añoRegalos VIP 2013 - Fin de año
Regalos VIP 2013 - Fin de añoRegalos Vip
 

En vedette (20)

Trish dillon 4.5
Trish dillon 4.5Trish dillon 4.5
Trish dillon 4.5
 
Is.triptico.6.329474
Is.triptico.6.329474Is.triptico.6.329474
Is.triptico.6.329474
 
Mobicules iPhone profile
Mobicules iPhone profileMobicules iPhone profile
Mobicules iPhone profile
 
INTRODUCCIÓN A LA ECONOMÍA RODERICK RODRIGUEZ
INTRODUCCIÓN A LA ECONOMÍA RODERICK RODRIGUEZINTRODUCCIÓN A LA ECONOMÍA RODERICK RODRIGUEZ
INTRODUCCIÓN A LA ECONOMÍA RODERICK RODRIGUEZ
 
Academic CV Jodi L Mathieu
Academic CV Jodi L MathieuAcademic CV Jodi L Mathieu
Academic CV Jodi L Mathieu
 
Tipografia
TipografiaTipografia
Tipografia
 
MHS-Rads-Specification-Guide_JUNE-2015
MHS-Rads-Specification-Guide_JUNE-2015MHS-Rads-Specification-Guide_JUNE-2015
MHS-Rads-Specification-Guide_JUNE-2015
 
Los geto dacios
Los geto daciosLos geto dacios
Los geto dacios
 
Askozia und peoplefone - Webinar 2016, deutsch
Askozia und peoplefone - Webinar 2016, deutschAskozia und peoplefone - Webinar 2016, deutsch
Askozia und peoplefone - Webinar 2016, deutsch
 
DKK 105
DKK 105DKK 105
DKK 105
 
Ag nr. 8477 q cells monokristallin (1)
Ag nr. 8477 q cells monokristallin (1)Ag nr. 8477 q cells monokristallin (1)
Ag nr. 8477 q cells monokristallin (1)
 
Problemario av
Problemario avProblemario av
Problemario av
 
Komplexe Zahlen
Komplexe ZahlenKomplexe Zahlen
Komplexe Zahlen
 
How to improve your email productivity to be more effective at work
How to improve your email productivity to be more effective at workHow to improve your email productivity to be more effective at work
How to improve your email productivity to be more effective at work
 
Adwords Seminar 3: PLAs - How to do and Optimise
Adwords Seminar 3: PLAs - How to do and OptimiseAdwords Seminar 3: PLAs - How to do and Optimise
Adwords Seminar 3: PLAs - How to do and Optimise
 
Trastornos de ee
Trastornos de eeTrastornos de ee
Trastornos de ee
 
Folleto CAN Completo
Folleto CAN CompletoFolleto CAN Completo
Folleto CAN Completo
 
Tutorial de uso de Autentico Chalk Paint
Tutorial de uso de Autentico Chalk PaintTutorial de uso de Autentico Chalk Paint
Tutorial de uso de Autentico Chalk Paint
 
Roi email marketing - presentacion.ppt web - gastón zarlenga - go plus
Roi   email marketing - presentacion.ppt web - gastón zarlenga - go plusRoi   email marketing - presentacion.ppt web - gastón zarlenga - go plus
Roi email marketing - presentacion.ppt web - gastón zarlenga - go plus
 
Regalos VIP 2013 - Fin de año
Regalos VIP 2013 - Fin de añoRegalos VIP 2013 - Fin de año
Regalos VIP 2013 - Fin de año
 

Similaire à Traxo Presentation - Facebook Garage Dallas 09

Leveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsLeveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsDavid Keener
 
Facebook Connect Integration
Facebook Connect IntegrationFacebook Connect Integration
Facebook Connect Integrationmujahidslideshare
 
MozCon Seattle 2011 - Social Design
MozCon Seattle 2011 - Social DesignMozCon Seattle 2011 - Social Design
MozCon Seattle 2011 - Social DesignMat Clayton
 
Building Facebook Apps
Building Facebook AppsBuilding Facebook Apps
Building Facebook AppsDavid Keener
 
Php day 2011 - Interactive-with-facebook
Php day 2011 - Interactive-with-facebookPhp day 2011 - Interactive-with-facebook
Php day 2011 - Interactive-with-facebookQuang Anh Le
 
funP 開發者俱樂部 十月份聚會
funP 開發者俱樂部 十月份聚會funP 開發者俱樂部 十月份聚會
funP 開發者俱樂部 十月份聚會tutchiio
 
Build Location Based App on bada
Build Location Based App on badaBuild Location Based App on bada
Build Location Based App on badaCheng Luo
 
Interactive with-facebook
Interactive with-facebookInteractive with-facebook
Interactive with-facebookTien Nguyen
 
funP 麻吉 開發者俱樂部十月份聚會
funP 麻吉 開發者俱樂部十月份聚會funP 麻吉 開發者俱樂部十月份聚會
funP 麻吉 開發者俱樂部十月份聚會Nathan Chiu
 
Intro To Bebo Applications by Thought Labs
Intro To Bebo Applications by Thought LabsIntro To Bebo Applications by Thought Labs
Intro To Bebo Applications by Thought LabsJohn Maver
 
Connect with Facebook to Rails Application By Nyros Developer
Connect with Facebook to Rails Application By Nyros DeveloperConnect with Facebook to Rails Application By Nyros Developer
Connect with Facebook to Rails Application By Nyros DeveloperNyros Technologies
 
Creating a content managed facebook app
Creating a content managed facebook appCreating a content managed facebook app
Creating a content managed facebook appOS-Cubed, Inc.
 
Google App Engine and Social Apps
Google App Engine and Social AppsGoogle App Engine and Social Apps
Google App Engine and Social AppsChris Schalk
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013Kiril Iliev
 
Facebook Platform for Developers
Facebook Platform for DevelopersFacebook Platform for Developers
Facebook Platform for DevelopersLidan Hifi
 
Facebook für PHP Entwickler - phpugffm
Facebook für PHP Entwickler - phpugffmFacebook für PHP Entwickler - phpugffm
Facebook für PHP Entwickler - phpugffmStephan Hochdörfer
 
Fb request form guide
Fb request form guideFb request form guide
Fb request form guidetamirc
 

Similaire à Traxo Presentation - Facebook Garage Dallas 09 (20)

Leveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsLeveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook Apps
 
Facebook Connect Integration
Facebook Connect IntegrationFacebook Connect Integration
Facebook Connect Integration
 
MozCon Seattle 2011 - Social Design
MozCon Seattle 2011 - Social DesignMozCon Seattle 2011 - Social Design
MozCon Seattle 2011 - Social Design
 
Building Facebook Apps
Building Facebook AppsBuilding Facebook Apps
Building Facebook Apps
 
Facebook Connect
Facebook ConnectFacebook Connect
Facebook Connect
 
Php day 2011 - Interactive-with-facebook
Php day 2011 - Interactive-with-facebookPhp day 2011 - Interactive-with-facebook
Php day 2011 - Interactive-with-facebook
 
funP 開發者俱樂部 十月份聚會
funP 開發者俱樂部 十月份聚會funP 開發者俱樂部 十月份聚會
funP 開發者俱樂部 十月份聚會
 
Build Location Based App on bada
Build Location Based App on badaBuild Location Based App on bada
Build Location Based App on bada
 
Interactive with-facebook
Interactive with-facebookInteractive with-facebook
Interactive with-facebook
 
funP 麻吉 開發者俱樂部十月份聚會
funP 麻吉 開發者俱樂部十月份聚會funP 麻吉 開發者俱樂部十月份聚會
funP 麻吉 開發者俱樂部十月份聚會
 
Intro To Bebo Applications by Thought Labs
Intro To Bebo Applications by Thought LabsIntro To Bebo Applications by Thought Labs
Intro To Bebo Applications by Thought Labs
 
Connect with Facebook to Rails Application By Nyros Developer
Connect with Facebook to Rails Application By Nyros DeveloperConnect with Facebook to Rails Application By Nyros Developer
Connect with Facebook to Rails Application By Nyros Developer
 
The social media developer
The social media developer The social media developer
The social media developer
 
Creating a content managed facebook app
Creating a content managed facebook appCreating a content managed facebook app
Creating a content managed facebook app
 
Google App Engine and Social Apps
Google App Engine and Social AppsGoogle App Engine and Social Apps
Google App Engine and Social Apps
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
 
Facebook Platform for Developers
Facebook Platform for DevelopersFacebook Platform for Developers
Facebook Platform for Developers
 
Jsf 2.0 in depth
Jsf 2.0 in depthJsf 2.0 in depth
Jsf 2.0 in depth
 
Facebook für PHP Entwickler - phpugffm
Facebook für PHP Entwickler - phpugffmFacebook für PHP Entwickler - phpugffm
Facebook für PHP Entwickler - phpugffm
 
Fb request form guide
Fb request form guideFb request form guide
Fb request form guide
 

Dernier

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Dernier (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Traxo Presentation - Facebook Garage Dallas 09

  • 1.
  • 2. 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
  • 3. 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
  • 4. on traxo.com, friends can: • share travel plans • seek travel advice • see travel matches . . . automatically
  • 5. Why Facebook Connect? • travel is social • fb becoming de facto identity standard • unprecedented distribution • close to seamless social graph portability
  • 7. More on Layouts facebook_init.ctp • Included by Other Layouts (default.ctp) • Inserted Near the Footer
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14. Integration Points – Connect Site • Connect Button • Facebook Icon • Profile Pictures • Invite Friends • Publish Actions
  • 15. Integration Points - Facebook.com • App Canvas • Feed / Stream • Profile • Tabs
  • 16. 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/
  • 17. 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
  • 18. 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
  • 19. 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
  • 20. 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
  • 21. 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
  • 22. 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.
  • 23. 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 } ?>
  • 24. 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()
  • 25. 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; } } }
  • 26. 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 }
  • 27. 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
  • 28. 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
  • 29. 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
  • 30. 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
  • 31. 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)
  • 32. 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
  • 33. 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
  • 36. canvas • apps.facebook.com/yourappname • app/views/connect/canvas.ctp – Implements a Custom Cake Layout for Facebook
  • 38. 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
  • 39. 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 ) { }
  • 40. 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>
  • 42. 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
  • 43. invite • Destination Handler for Friend Invites • Application Specific • Facebook Will POST to this URL With Any Parameters Specified from invite_friends • No User Interface
  • 44. Questions? ...Launching this Summer
  • 45.
  • 46.
  • 47. 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
  • 48. 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(); }); });
  • 49. 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 } ?>