SlideShare une entreprise Scribd logo
1  sur  50
Télécharger pour lire hors ligne
Facebook für (PHP) Entwickler
Facebook für (PHP) Entwickler

 Über mich

  Stephan Hochdörfer, bitExpert AG
  Department Manager Research Labs
  S.Hochdoerfer@bitExpert.de
  @shochdoerfer
  http://www.facebook.com/shochdoerfer
Facebook für (PHP) Entwickler

 Facebook Fakten

  Mehr als 800 Millionen aktive User
  Mehr als 900 Millionen Objekte (Pages, Gruppen, Events,...)
  ~20 Millionen Apps werden pro Tag installiert
  Pro Monat nutzen mehr als 500 Millionen User FB Apps
  ~350 Millionen User mit mobilen Clients




 Quelle: https://www.facebook.com/press/info.php?statistics
Facebook für (PHP) Entwickler




      Was kann der Entwickler nutzen?
Facebook für (PHP) Entwickler




 Social Plugins
Facebook für (PHP) Entwickler

 Facebook Social Plugins – Like Button
 <div id="fb-root"></div>
 <script>(function(d, s, id) {
   var js, fjs = d.getElementsByTagName(s)[0];
   if (d.getElementById(id)) {return;}
   js = d.createElement(s); js.id = id;
   js.src =
 "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=0815";
   fjs.parentNode.insertBefore(js, fjs);
 }(document, 'script', 'facebook-jssdk'));</script>


 <div class="fb-like" data-href="http://www.phpugffm.de" data-
 send="false" data-width="450" data-show-faces="true"></div>
Facebook für (PHP) Entwickler




 Mobile Applikationen
Facebook für (PHP) Entwickler




 Facebook Applikationen
Facebook Apps: Entwicklungsleitfaden




 Canvas Applikation
Facebook Apps: Entwicklungsleitfaden




 Seitenreiter Applikation
Facebook für (PHP) Entwickler

 Die erste Facebook Applikation




                    Wie geht es los?
Facebook für (PHP) Entwickler




 http://developers.facebook.com
Facebook für (PHP) Entwickler




 http://developers.facebook.com/apps
Facebook für (PHP) Entwickler
Facebook für (PHP) Entwickler
Facebook für (PHP) Entwickler
Facebook für (PHP) Entwickler

 Facebook PHP SDK




    https://github.com/facebook/php-sdk
Facebook für (PHP) Entwickler

 Facebook PHP SDK
 <?php
 require '../lib/facebook/facebook.php';

 $facebook = new Facebook(array(
   'appId' => 'YOUR_APP_ID',
   'secret' => 'YOUR_APP_SECRET',
 ));

 // Get User ID
 $user = $facebook->getUser();
Facebook für (PHP) Entwickler

 Facebook PHP SDK




                   Kein PSR-0? WTF?
Facebook für (PHP) Entwickler

 Facebook PHP SDK – PSR-0 work-a-round
 <?php
 require_once(__DIR__.'/facebook.php');


 /**
  * Facebook client, PSR-0 style
  */


 class Facebook_Client extends Facebook
 {
 }
Facebook für (PHP) Entwickler

 Facebook PHP SDK – PSR-0 work-a-round
 <?php

 $facebook = new Facebook_Client(array(
   'appId' => 'YOUR_APP_ID',
   'secret' => 'YOUR_APP_SECRET',
 ));

 // Get User ID
 $user = $facebook->getUser();
Facebook für (PHP) Entwickler

 Die erste Facebook App
 <!DOCTYPE html>
 <html>
 <body>
 <div id="fb-root"></div>
 <script type="text/javascript">
 window.fbAsyncInit = function() {
      FB.init({
          appId: 'YOUR_APP_ID', status: true, cookie: true, xfbml: true, oauth:
 true
      });
 };
 (function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) {return;}
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=YOUR_APP_ID";
      fjs.parentNode.insertBefore(js, fjs);
 }(document, 'script', 'facebook-jssdk'));
 </script>
 <div class="wrapper"></div>
 </body>
 </html>
Facebook für (PHP) Entwickler

 Die erste Facebook App
 <!DOCTYPE html>
 <html>
 <body>
 <div id="fb-root"></div>
 <script type="text/javascript">
 window.fbAsyncInit = function() {
      FB.init({
          appId: 'YOUR_APP_ID', status: true, cookie: true, xfbml: true, oauth:
 true
      });
 };
 (function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) {return;}
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=YOUR_APP_ID";
      fjs.parentNode.insertBefore(js, fjs);
 }(document, 'script', 'facebook-jssdk'));
 </script>
 <div class="wrapper"></div>
 </body>
 </html>
Facebook für (PHP) Entwickler

 Die erste Facebook App
 <!DOCTYPE html>
 <html>
 <body>
 <div id="fb-root"></div>
 <script type="text/javascript">
 window.fbAsyncInit = function() {
      FB.init({
          appId: 'YOUR_APP_ID', status: true, cookie: true, xfbml: true, oauth:
 true
      });
 };
 (function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) {return;}
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=YOUR_APP_ID";
      fjs.parentNode.insertBefore(js, fjs);
 }(document, 'script', 'facebook-jssdk'));
 </script>
 <div class="wrapper"></div>
 </body>
 </html>
Facebook für (PHP) Entwickler

 Die erste Facebook App
 <!DOCTYPE html>
 <html>
 <body>
 <div id="fb-root"></div>
 <script type="text/javascript">
 window.fbAsyncInit = function() {
      FB.init({
          appId: 'YOUR_APP_ID', status: true, cookie: true, xfbml: true, oauth:
 true
      });
 };
 (function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) {return;}
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=YOUR_APP_ID";
      fjs.parentNode.insertBefore(js, fjs);
 }(document, 'script', 'facebook-jssdk'));
 </script>
 <div class="wrapper"></div>
 </body>
 </html>
Facebook für (PHP) Entwickler

 Die erste Facebook App




    Wie kommt die App auf die Fanpage?
Facebook für (PHP) Entwickler

 Die erste Facebook App – Fanpage Integration




https://www.facebook.com/dialog/pagetab
?app_id=YOUR_APP_ID&next=YOUR_URL
Facebook für (PHP) Entwickler

 Die erste Facebook App – Fanpage Integration
Facebook Apps: Entwicklungsleitfaden




 Fertig :)
Facebook für (PHP) Entwickler

 Request Flow


                                       HTTP Post Request
                                       + signed_request

         User /             Facebook                Applikations-
        Browser              Fanpage                  server
Facebook für (PHP) Entwickler

 Request Flow - signed_request

  sicherer Datenaustausch zw. Facebook und der eigenen
  App
  Konkatenation HMAC SHA-256 Signatur, einem Punkt (.)
  und einem base64 kodierten JSON Objekt
  Zum Dekodieren wird das App Secret benötigt!
  Enthält Informationen zum User, Fanpage und Deeplink
  Parameter
Facebook für (PHP) Entwickler




 Wer ist der User?
Facebook für (PHP) Entwickler

 Login / Authentifzierung
 FB.getLoginStatus(function(response) {
       if (response.authResponse) {
           // User eingeloggt
       } else {
           // Versuchen den User einzuloggen
           FB.login(function(response) {
                if(response.authResponse) {
                    if(response.perms) {
                         // ist eingeloggt....
                    }
                }
           }, {
                perms: 'publish_stream, offline_access'
           });
       }
 });
Facebook für (PHP) Entwickler

 Login / Authentifzierung – Signed Request




  Neuer signed_request nach dem Login!
Facebook für (PHP) Entwickler

 Login / Authentifzierung – User Perms

 user_about_me, user_activities, user_birthday,
 user_checkins, user_education_history, user_events,
 user_groups, user_hometown, user_interests, user_likes,
 user_location, user_notes, user_online_presence,
 user_photo_video_tags, user_photos, user_questions,
 user_relationships, user_relationships_details,
 user_religion_politics, user_status, user_videos,
 user_website, user_work_history, email
Facebook für (PHP) Entwickler

 Login / Authentifzierung – Extended Perms

 read_friendlists, read_insights, read_mailbox,
 read_requests, read_stream, xmpp_login,
 ads_management, create_event, manage_friendlists,
 manage_notifications, offline_access, publish_checkins,
 publish_stream, rsvp_event, sms, publish_actions,
 manage_pages
Facebook für (PHP) Entwickler




   The Graph API presents a simple,
 consistent view of the Facebook social
graph, uniformly representing objects in
the graph and the connections between
                 them.
Facebook für (PHP) Entwickler

 Graph API – Wer bin ich?




      https://graph.facebook.com/me?
               access_token=
Facebook für (PHP) Entwickler

 Graph API – Wer sind meine Freunde?




https://graph.facebook.com/me/friends?
             access_token=
Facebook für (PHP) Entwickler

 Graph API – Was mag ich?




  https://graph.facebook.com/me/likes?
              access_token=
Facebook für (PHP) Entwickler

 Graph API (JS Style)
 FB.api('/me', function(response) {
   alert(response.name);
 });
Facebook für (PHP) Entwickler

 Graph API (JS Style)
 var msg = 'Hello phpugffm!';

 FB.api('/me/feed', 'post', { message: msg }, function(response) {
   if (!response || response.error) {
     alert('Error occured');
   } else {
     alert('Post ID: ' + response.id);
   }
 });
Facebook für (PHP) Entwickler

 Graph API (PHP Style)
 <?php

 $post = array(
     'message' => 'Hello phpugffm!',
 );

 $facebook->api('/me/feed', 'post', $post);
Facebook für (PHP) Entwickler




    FQL enables you to use a SQL-style
  interface to query the data exposed by
               the Graph API.
Facebook für (PHP) Entwickler

 FQL Tabellen

album, application, apprequest, checkin, comment,
comments_info, connection, cookies, developer, domain,
domain_admin, event, event_member, family, friend,
friend_request, friendlist, friendlist_member, group,
group_member, insights, like, link, link_stat, mailbox_folder,
message, note, notification, object_url, page, page_admin,
page_blocked_user, page_fan, permissions,
permissions_info, photo, photo_tag, place, privacy,
privacy_setting, profile, question, question_option,
question_option_votes, review, standard_friend_info,
standard_user_info, status, stream, stream_filter,
stream_tag, thread, translation, unified_thread,
unified_thread_action, user, ...
Facebook für (PHP) Entwickler

 FQL (JS Style)

 FB.api({
    method: 'fql.query',
    query: 'select first_name,last_name,email from user
 where uid = me()'
 },
 function(response) {
    console.log(response);
 });
Facebook Apps: Entwicklungsleitfaden

 FQL (JS Style) - Subselect

 FB.api({
    method: 'fql.query',
    query: 'select first_name,last_name,email from user
 where uid IN (SELECT uid2 FROM friend WHERE uid1 =
 me())'
 },
 function(response) {
    console.log(response);
 });
Facebook für (PHP) Entwickler

 Wallpost (JS Style)

 var pageId = 12345678;
 var post   = {
   message: '',
   name: 'Der Name des Links',
   caption: 'Die Beschreibung',
   link: 'http://www.facebook.com/'+pageId,
   attribution: 'Meine App'
 };

 FB.api('/'+pageId+'/feed', 'post', post);
Facebook für (PHP) Entwickler

 Wallpost (PHP Style)
 <?php

 $pageId = 12345678;
 $post   = array(
    'message'      =>    '',
    'name'         =>    'Der Name des Links',
    'caption'      =>    'Die Beschreibung',
    'link'         =>    'http://www.facebook.com/'.$pageId,
    'attribution' =>     'Meine App'
 );

 $facebook->api('/'.$pageId.'/feed', 'post', $post);
Vielen Dank!

Contenu connexe

En vedette

Simplify your external dependency management - DPC11
Simplify your external dependency management - DPC11Simplify your external dependency management - DPC11
Simplify your external dependency management - DPC11Stephan Hochdörfer
 
Testing untestable code - PHPUGFFM 01/11
Testing untestable code - PHPUGFFM 01/11Testing untestable code - PHPUGFFM 01/11
Testing untestable code - PHPUGFFM 01/11Stephan Hochdörfer
 
Testing untestable code - STPCon11
Testing untestable code - STPCon11Testing untestable code - STPCon11
Testing untestable code - STPCon11Stephan Hochdörfer
 
Testing untestable code - Herbstcampus12
Testing untestable code - Herbstcampus12Testing untestable code - Herbstcampus12
Testing untestable code - Herbstcampus12Stephan Hochdörfer
 
Testing untestable code - phpconpl11
Testing untestable code - phpconpl11Testing untestable code - phpconpl11
Testing untestable code - phpconpl11Stephan Hochdörfer
 
Offline Strategies for HTML5 Web Applications - ipc13
Offline Strategies for HTML5 Web Applications - ipc13Offline Strategies for HTML5 Web Applications - ipc13
Offline Strategies for HTML5 Web Applications - ipc13Stephan Hochdörfer
 
How to build customizable multitenant web applications - IPC11 Spring Edition
How to build customizable multitenant web applications - IPC11 Spring EditionHow to build customizable multitenant web applications - IPC11 Spring Edition
How to build customizable multitenant web applications - IPC11 Spring EditionStephan Hochdörfer
 
Phing for power users - frOSCon8
Phing for power users - frOSCon8Phing for power users - frOSCon8
Phing for power users - frOSCon8Stephan Hochdörfer
 
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015Innomatic Platform
 

En vedette (9)

Simplify your external dependency management - DPC11
Simplify your external dependency management - DPC11Simplify your external dependency management - DPC11
Simplify your external dependency management - DPC11
 
Testing untestable code - PHPUGFFM 01/11
Testing untestable code - PHPUGFFM 01/11Testing untestable code - PHPUGFFM 01/11
Testing untestable code - PHPUGFFM 01/11
 
Testing untestable code - STPCon11
Testing untestable code - STPCon11Testing untestable code - STPCon11
Testing untestable code - STPCon11
 
Testing untestable code - Herbstcampus12
Testing untestable code - Herbstcampus12Testing untestable code - Herbstcampus12
Testing untestable code - Herbstcampus12
 
Testing untestable code - phpconpl11
Testing untestable code - phpconpl11Testing untestable code - phpconpl11
Testing untestable code - phpconpl11
 
Offline Strategies for HTML5 Web Applications - ipc13
Offline Strategies for HTML5 Web Applications - ipc13Offline Strategies for HTML5 Web Applications - ipc13
Offline Strategies for HTML5 Web Applications - ipc13
 
How to build customizable multitenant web applications - IPC11 Spring Edition
How to build customizable multitenant web applications - IPC11 Spring EditionHow to build customizable multitenant web applications - IPC11 Spring Edition
How to build customizable multitenant web applications - IPC11 Spring Edition
 
Phing for power users - frOSCon8
Phing for power users - frOSCon8Phing for power users - frOSCon8
Phing for power users - frOSCon8
 
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
 

Similaire à Facebook für PHP Entwickler - phpugffm

Foundations of a Social Application Platform
Foundations of a Social Application PlatformFoundations of a Social Application Platform
Foundations of a Social Application PlatformJonathan LeBlanc
 
Workshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDKWorkshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDKDimitar Danailov
 
Facebook Connect Integration
Facebook Connect IntegrationFacebook Connect Integration
Facebook Connect Integrationmujahidslideshare
 
OAuth Introduction
OAuth IntroductionOAuth Introduction
OAuth Introductionh_marvin
 
The Face Behind Facebook
The Face Behind FacebookThe Face Behind Facebook
The Face Behind FacebookCory Bohon
 
Leveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsLeveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsDavid Keener
 
Shiny Agency's Facebook Development Guidelines
Shiny Agency's Facebook Development GuidelinesShiny Agency's Facebook Development Guidelines
Shiny Agency's Facebook Development GuidelinesRoy Pereira
 
fb-researchの舞台裏No.2~技術編~(HatchUp主催 渋谷Facebookアプリ勉強会)
fb-researchの舞台裏No.2~技術編~(HatchUp主催 渋谷Facebookアプリ勉強会)fb-researchの舞台裏No.2~技術編~(HatchUp主催 渋谷Facebookアプリ勉強会)
fb-researchの舞台裏No.2~技術編~(HatchUp主催 渋谷Facebookアプリ勉強会)modeelf
 
Facebook api
Facebook api Facebook api
Facebook api snipermkd
 
Facebook API
Facebook APIFacebook API
Facebook APIsnipermkd
 
23 FACEBOOK APP DEVELOPMENT ESSENTIALS
23 FACEBOOK APP DEVELOPMENT ESSENTIALS23 FACEBOOK APP DEVELOPMENT ESSENTIALS
23 FACEBOOK APP DEVELOPMENT ESSENTIALSNETNODE AG
 
Foundational Facebook Marketing
Foundational Facebook MarketingFoundational Facebook Marketing
Foundational Facebook MarketingBlitzMetrics
 
Open Hack Day Bangalore: Hacking Yahoo! Social
Open Hack Day Bangalore: Hacking Yahoo! SocialOpen Hack Day Bangalore: Hacking Yahoo! Social
Open Hack Day Bangalore: Hacking Yahoo! SocialSaurabh Sahni
 
Hi5 Hackathon Presentation
Hi5 Hackathon PresentationHi5 Hackathon Presentation
Hi5 Hackathon PresentationLou Moore
 
Facebook Apps Development 101 (Java)
Facebook Apps Development 101 (Java)Facebook Apps Development 101 (Java)
Facebook Apps Development 101 (Java)Damon Widjaja
 
Guia de Sobrevivência JS no mundo Open Source
Guia de Sobrevivência JS no mundo Open SourceGuia de Sobrevivência JS no mundo Open Source
Guia de Sobrevivência JS no mundo Open SourceLeonardo Balter
 

Similaire à Facebook für PHP Entwickler - phpugffm (20)

Foundations of a Social Application Platform
Foundations of a Social Application PlatformFoundations of a Social Application Platform
Foundations of a Social Application Platform
 
Workshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDKWorkshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDK
 
Facebook Connect Integration
Facebook Connect IntegrationFacebook Connect Integration
Facebook Connect Integration
 
OAuth Introduction
OAuth IntroductionOAuth Introduction
OAuth Introduction
 
The Face Behind Facebook
The Face Behind FacebookThe Face Behind Facebook
The Face Behind Facebook
 
Facebook Connect
Facebook ConnectFacebook Connect
Facebook Connect
 
Hi5 Open Social
Hi5   Open SocialHi5   Open Social
Hi5 Open Social
 
Leveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsLeveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook Apps
 
The social media developer
The social media developer The social media developer
The social media developer
 
Shiny Agency's Facebook Development Guidelines
Shiny Agency's Facebook Development GuidelinesShiny Agency's Facebook Development Guidelines
Shiny Agency's Facebook Development Guidelines
 
fb-researchの舞台裏No.2~技術編~(HatchUp主催 渋谷Facebookアプリ勉強会)
fb-researchの舞台裏No.2~技術編~(HatchUp主催 渋谷Facebookアプリ勉強会)fb-researchの舞台裏No.2~技術編~(HatchUp主催 渋谷Facebookアプリ勉強会)
fb-researchの舞台裏No.2~技術編~(HatchUp主催 渋谷Facebookアプリ勉強会)
 
Facebook api
Facebook api Facebook api
Facebook api
 
Facebook API
Facebook APIFacebook API
Facebook API
 
23 FACEBOOK APP DEVELOPMENT ESSENTIALS
23 FACEBOOK APP DEVELOPMENT ESSENTIALS23 FACEBOOK APP DEVELOPMENT ESSENTIALS
23 FACEBOOK APP DEVELOPMENT ESSENTIALS
 
Creating a Facebook App
Creating a Facebook AppCreating a Facebook App
Creating a Facebook App
 
Foundational Facebook Marketing
Foundational Facebook MarketingFoundational Facebook Marketing
Foundational Facebook Marketing
 
Open Hack Day Bangalore: Hacking Yahoo! Social
Open Hack Day Bangalore: Hacking Yahoo! SocialOpen Hack Day Bangalore: Hacking Yahoo! Social
Open Hack Day Bangalore: Hacking Yahoo! Social
 
Hi5 Hackathon Presentation
Hi5 Hackathon PresentationHi5 Hackathon Presentation
Hi5 Hackathon Presentation
 
Facebook Apps Development 101 (Java)
Facebook Apps Development 101 (Java)Facebook Apps Development 101 (Java)
Facebook Apps Development 101 (Java)
 
Guia de Sobrevivência JS no mundo Open Source
Guia de Sobrevivência JS no mundo Open SourceGuia de Sobrevivência JS no mundo Open Source
Guia de Sobrevivência JS no mundo Open Source
 

Plus de Stephan Hochdörfer

Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...
Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...
Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...Stephan Hochdörfer
 
Offline strategies for HTML5 web applications - frOSCon8
Offline strategies for HTML5 web applications - frOSCon8Offline strategies for HTML5 web applications - frOSCon8
Offline strategies for HTML5 web applications - frOSCon8Stephan Hochdörfer
 
Offline Strategies for HTML5 Web Applications - oscon13
Offline Strategies for HTML5 Web Applications - oscon13Offline Strategies for HTML5 Web Applications - oscon13
Offline Strategies for HTML5 Web Applications - oscon13Stephan Hochdörfer
 
Real World Dependency Injection - oscon13
Real World Dependency Injection - oscon13Real World Dependency Injection - oscon13
Real World Dependency Injection - oscon13Stephan Hochdörfer
 
Dependency Injection in PHP - dwx13
Dependency Injection in PHP - dwx13Dependency Injection in PHP - dwx13
Dependency Injection in PHP - dwx13Stephan Hochdörfer
 
Offline Strategien für HTML5 Web Applikationen - dwx13
Offline Strategien für HTML5 Web Applikationen - dwx13 Offline Strategien für HTML5 Web Applikationen - dwx13
Offline Strategien für HTML5 Web Applikationen - dwx13 Stephan Hochdörfer
 
Your Business. Your Language. Your Code - dpc13
Your Business. Your Language. Your Code - dpc13Your Business. Your Language. Your Code - dpc13
Your Business. Your Language. Your Code - dpc13Stephan Hochdörfer
 
Phing for power users - dpc_uncon13
Phing for power users - dpc_uncon13Phing for power users - dpc_uncon13
Phing for power users - dpc_uncon13Stephan Hochdörfer
 
Offline-Strategien für HTML5 Web Applikationen - wmka
Offline-Strategien für HTML5 Web Applikationen - wmkaOffline-Strategien für HTML5 Web Applikationen - wmka
Offline-Strategien für HTML5 Web Applikationen - wmkaStephan Hochdörfer
 
Offline-Strategien für HTML5 Web Applikationen - bedcon13
Offline-Strategien für HTML5 Web Applikationen - bedcon13Offline-Strategien für HTML5 Web Applikationen - bedcon13
Offline-Strategien für HTML5 Web Applikationen - bedcon13Stephan Hochdörfer
 
Real World Dependency Injection - phpugffm13
Real World Dependency Injection - phpugffm13Real World Dependency Injection - phpugffm13
Real World Dependency Injection - phpugffm13Stephan Hochdörfer
 
Testing untestable code - ConFoo13
Testing untestable code - ConFoo13Testing untestable code - ConFoo13
Testing untestable code - ConFoo13Stephan Hochdörfer
 
Offline strategies for HTML5 web applications - ConFoo13
Offline strategies for HTML5 web applications - ConFoo13Offline strategies for HTML5 web applications - ConFoo13
Offline strategies for HTML5 web applications - ConFoo13Stephan Hochdörfer
 
Offline-Strategien für HTML5Web Applikationen - WMMRN12
Offline-Strategien für HTML5Web Applikationen - WMMRN12Offline-Strategien für HTML5Web Applikationen - WMMRN12
Offline-Strategien für HTML5Web Applikationen - WMMRN12Stephan Hochdörfer
 
Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12Stephan Hochdörfer
 
Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12
Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12
Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12Stephan Hochdörfer
 
Offline strategies for HTML5 web applications - pfCongres2012
Offline strategies for HTML5 web applications - pfCongres2012Offline strategies for HTML5 web applications - pfCongres2012
Offline strategies for HTML5 web applications - pfCongres2012Stephan Hochdörfer
 
Wie Software-Generatoren die Welt verändern können - Herbstcampus12
Wie Software-Generatoren die Welt verändern können - Herbstcampus12Wie Software-Generatoren die Welt verändern können - Herbstcampus12
Wie Software-Generatoren die Welt verändern können - Herbstcampus12Stephan Hochdörfer
 

Plus de Stephan Hochdörfer (20)

Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...
Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...
Offline. Na und? Strategien für offlinefähige Applikationen in HTML5 - Herbst...
 
Offline strategies for HTML5 web applications - frOSCon8
Offline strategies for HTML5 web applications - frOSCon8Offline strategies for HTML5 web applications - frOSCon8
Offline strategies for HTML5 web applications - frOSCon8
 
Offline Strategies for HTML5 Web Applications - oscon13
Offline Strategies for HTML5 Web Applications - oscon13Offline Strategies for HTML5 Web Applications - oscon13
Offline Strategies for HTML5 Web Applications - oscon13
 
Real World Dependency Injection - oscon13
Real World Dependency Injection - oscon13Real World Dependency Injection - oscon13
Real World Dependency Injection - oscon13
 
Dependency Injection in PHP - dwx13
Dependency Injection in PHP - dwx13Dependency Injection in PHP - dwx13
Dependency Injection in PHP - dwx13
 
Offline Strategien für HTML5 Web Applikationen - dwx13
Offline Strategien für HTML5 Web Applikationen - dwx13 Offline Strategien für HTML5 Web Applikationen - dwx13
Offline Strategien für HTML5 Web Applikationen - dwx13
 
Your Business. Your Language. Your Code - dpc13
Your Business. Your Language. Your Code - dpc13Your Business. Your Language. Your Code - dpc13
Your Business. Your Language. Your Code - dpc13
 
Phing for power users - dpc_uncon13
Phing for power users - dpc_uncon13Phing for power users - dpc_uncon13
Phing for power users - dpc_uncon13
 
Offline-Strategien für HTML5 Web Applikationen - wmka
Offline-Strategien für HTML5 Web Applikationen - wmkaOffline-Strategien für HTML5 Web Applikationen - wmka
Offline-Strategien für HTML5 Web Applikationen - wmka
 
Offline-Strategien für HTML5 Web Applikationen - bedcon13
Offline-Strategien für HTML5 Web Applikationen - bedcon13Offline-Strategien für HTML5 Web Applikationen - bedcon13
Offline-Strategien für HTML5 Web Applikationen - bedcon13
 
Real World Dependency Injection - phpugffm13
Real World Dependency Injection - phpugffm13Real World Dependency Injection - phpugffm13
Real World Dependency Injection - phpugffm13
 
Testing untestable code - ConFoo13
Testing untestable code - ConFoo13Testing untestable code - ConFoo13
Testing untestable code - ConFoo13
 
A Phing fairy tale - ConFoo13
A Phing fairy tale - ConFoo13A Phing fairy tale - ConFoo13
A Phing fairy tale - ConFoo13
 
Offline strategies for HTML5 web applications - ConFoo13
Offline strategies for HTML5 web applications - ConFoo13Offline strategies for HTML5 web applications - ConFoo13
Offline strategies for HTML5 web applications - ConFoo13
 
Offline-Strategien für HTML5Web Applikationen - WMMRN12
Offline-Strategien für HTML5Web Applikationen - WMMRN12Offline-Strategien für HTML5Web Applikationen - WMMRN12
Offline-Strategien für HTML5Web Applikationen - WMMRN12
 
Testing untestable code - IPC12
Testing untestable code - IPC12Testing untestable code - IPC12
Testing untestable code - IPC12
 
Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12
 
Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12
Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12
Große Systeme, lose Kopplung, Spaß bei der Arbeit! - WDC12
 
Offline strategies for HTML5 web applications - pfCongres2012
Offline strategies for HTML5 web applications - pfCongres2012Offline strategies for HTML5 web applications - pfCongres2012
Offline strategies for HTML5 web applications - pfCongres2012
 
Wie Software-Generatoren die Welt verändern können - Herbstcampus12
Wie Software-Generatoren die Welt verändern können - Herbstcampus12Wie Software-Generatoren die Welt verändern können - Herbstcampus12
Wie Software-Generatoren die Welt verändern können - Herbstcampus12
 

Dernier

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 

Dernier (20)

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 

Facebook für PHP Entwickler - phpugffm

  • 1. Facebook für (PHP) Entwickler
  • 2. Facebook für (PHP) Entwickler Über mich  Stephan Hochdörfer, bitExpert AG  Department Manager Research Labs  S.Hochdoerfer@bitExpert.de  @shochdoerfer  http://www.facebook.com/shochdoerfer
  • 3. Facebook für (PHP) Entwickler Facebook Fakten  Mehr als 800 Millionen aktive User  Mehr als 900 Millionen Objekte (Pages, Gruppen, Events,...)  ~20 Millionen Apps werden pro Tag installiert  Pro Monat nutzen mehr als 500 Millionen User FB Apps  ~350 Millionen User mit mobilen Clients Quelle: https://www.facebook.com/press/info.php?statistics
  • 4. Facebook für (PHP) Entwickler Was kann der Entwickler nutzen?
  • 5. Facebook für (PHP) Entwickler Social Plugins
  • 6. Facebook für (PHP) Entwickler Facebook Social Plugins – Like Button <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=0815"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="fb-like" data-href="http://www.phpugffm.de" data- send="false" data-width="450" data-show-faces="true"></div>
  • 7. Facebook für (PHP) Entwickler Mobile Applikationen
  • 8. Facebook für (PHP) Entwickler Facebook Applikationen
  • 10. Facebook Apps: Entwicklungsleitfaden Seitenreiter Applikation
  • 11. Facebook für (PHP) Entwickler Die erste Facebook Applikation Wie geht es los?
  • 12. Facebook für (PHP) Entwickler http://developers.facebook.com
  • 13. Facebook für (PHP) Entwickler http://developers.facebook.com/apps
  • 14. Facebook für (PHP) Entwickler
  • 15. Facebook für (PHP) Entwickler
  • 16. Facebook für (PHP) Entwickler
  • 17. Facebook für (PHP) Entwickler Facebook PHP SDK https://github.com/facebook/php-sdk
  • 18. Facebook für (PHP) Entwickler Facebook PHP SDK <?php require '../lib/facebook/facebook.php'; $facebook = new Facebook(array( 'appId' => 'YOUR_APP_ID', 'secret' => 'YOUR_APP_SECRET', )); // Get User ID $user = $facebook->getUser();
  • 19. Facebook für (PHP) Entwickler Facebook PHP SDK Kein PSR-0? WTF?
  • 20. Facebook für (PHP) Entwickler Facebook PHP SDK – PSR-0 work-a-round <?php require_once(__DIR__.'/facebook.php'); /** * Facebook client, PSR-0 style */ class Facebook_Client extends Facebook { }
  • 21. Facebook für (PHP) Entwickler Facebook PHP SDK – PSR-0 work-a-round <?php $facebook = new Facebook_Client(array( 'appId' => 'YOUR_APP_ID', 'secret' => 'YOUR_APP_SECRET', )); // Get User ID $user = $facebook->getUser();
  • 22. Facebook für (PHP) Entwickler Die erste Facebook App <!DOCTYPE html> <html> <body> <div id="fb-root"></div> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({ appId: 'YOUR_APP_ID', status: true, cookie: true, xfbml: true, oauth: true }); }; (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=YOUR_APP_ID"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <div class="wrapper"></div> </body> </html>
  • 23. Facebook für (PHP) Entwickler Die erste Facebook App <!DOCTYPE html> <html> <body> <div id="fb-root"></div> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({ appId: 'YOUR_APP_ID', status: true, cookie: true, xfbml: true, oauth: true }); }; (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=YOUR_APP_ID"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <div class="wrapper"></div> </body> </html>
  • 24. Facebook für (PHP) Entwickler Die erste Facebook App <!DOCTYPE html> <html> <body> <div id="fb-root"></div> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({ appId: 'YOUR_APP_ID', status: true, cookie: true, xfbml: true, oauth: true }); }; (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=YOUR_APP_ID"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <div class="wrapper"></div> </body> </html>
  • 25. Facebook für (PHP) Entwickler Die erste Facebook App <!DOCTYPE html> <html> <body> <div id="fb-root"></div> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({ appId: 'YOUR_APP_ID', status: true, cookie: true, xfbml: true, oauth: true }); }; (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=YOUR_APP_ID"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <div class="wrapper"></div> </body> </html>
  • 26. Facebook für (PHP) Entwickler Die erste Facebook App Wie kommt die App auf die Fanpage?
  • 27. Facebook für (PHP) Entwickler Die erste Facebook App – Fanpage Integration https://www.facebook.com/dialog/pagetab ?app_id=YOUR_APP_ID&next=YOUR_URL
  • 28. Facebook für (PHP) Entwickler Die erste Facebook App – Fanpage Integration
  • 30. Facebook für (PHP) Entwickler Request Flow HTTP Post Request + signed_request User / Facebook Applikations- Browser Fanpage server
  • 31. Facebook für (PHP) Entwickler Request Flow - signed_request  sicherer Datenaustausch zw. Facebook und der eigenen App  Konkatenation HMAC SHA-256 Signatur, einem Punkt (.) und einem base64 kodierten JSON Objekt  Zum Dekodieren wird das App Secret benötigt!  Enthält Informationen zum User, Fanpage und Deeplink Parameter
  • 32. Facebook für (PHP) Entwickler Wer ist der User?
  • 33. Facebook für (PHP) Entwickler Login / Authentifzierung FB.getLoginStatus(function(response) { if (response.authResponse) { // User eingeloggt } else { // Versuchen den User einzuloggen FB.login(function(response) { if(response.authResponse) { if(response.perms) { // ist eingeloggt.... } } }, { perms: 'publish_stream, offline_access' }); } });
  • 34. Facebook für (PHP) Entwickler Login / Authentifzierung – Signed Request Neuer signed_request nach dem Login!
  • 35. Facebook für (PHP) Entwickler Login / Authentifzierung – User Perms user_about_me, user_activities, user_birthday, user_checkins, user_education_history, user_events, user_groups, user_hometown, user_interests, user_likes, user_location, user_notes, user_online_presence, user_photo_video_tags, user_photos, user_questions, user_relationships, user_relationships_details, user_religion_politics, user_status, user_videos, user_website, user_work_history, email
  • 36. Facebook für (PHP) Entwickler Login / Authentifzierung – Extended Perms read_friendlists, read_insights, read_mailbox, read_requests, read_stream, xmpp_login, ads_management, create_event, manage_friendlists, manage_notifications, offline_access, publish_checkins, publish_stream, rsvp_event, sms, publish_actions, manage_pages
  • 37. Facebook für (PHP) Entwickler The Graph API presents a simple, consistent view of the Facebook social graph, uniformly representing objects in the graph and the connections between them.
  • 38. Facebook für (PHP) Entwickler Graph API – Wer bin ich? https://graph.facebook.com/me? access_token=
  • 39. Facebook für (PHP) Entwickler Graph API – Wer sind meine Freunde? https://graph.facebook.com/me/friends? access_token=
  • 40. Facebook für (PHP) Entwickler Graph API – Was mag ich? https://graph.facebook.com/me/likes? access_token=
  • 41. Facebook für (PHP) Entwickler Graph API (JS Style) FB.api('/me', function(response) { alert(response.name); });
  • 42. Facebook für (PHP) Entwickler Graph API (JS Style) var msg = 'Hello phpugffm!'; FB.api('/me/feed', 'post', { message: msg }, function(response) { if (!response || response.error) { alert('Error occured'); } else { alert('Post ID: ' + response.id); } });
  • 43. Facebook für (PHP) Entwickler Graph API (PHP Style) <?php $post = array( 'message' => 'Hello phpugffm!', ); $facebook->api('/me/feed', 'post', $post);
  • 44. Facebook für (PHP) Entwickler FQL enables you to use a SQL-style interface to query the data exposed by the Graph API.
  • 45. Facebook für (PHP) Entwickler FQL Tabellen album, application, apprequest, checkin, comment, comments_info, connection, cookies, developer, domain, domain_admin, event, event_member, family, friend, friend_request, friendlist, friendlist_member, group, group_member, insights, like, link, link_stat, mailbox_folder, message, note, notification, object_url, page, page_admin, page_blocked_user, page_fan, permissions, permissions_info, photo, photo_tag, place, privacy, privacy_setting, profile, question, question_option, question_option_votes, review, standard_friend_info, standard_user_info, status, stream, stream_filter, stream_tag, thread, translation, unified_thread, unified_thread_action, user, ...
  • 46. Facebook für (PHP) Entwickler FQL (JS Style) FB.api({ method: 'fql.query', query: 'select first_name,last_name,email from user where uid = me()' }, function(response) { console.log(response); });
  • 47. Facebook Apps: Entwicklungsleitfaden FQL (JS Style) - Subselect FB.api({ method: 'fql.query', query: 'select first_name,last_name,email from user where uid IN (SELECT uid2 FROM friend WHERE uid1 = me())' }, function(response) { console.log(response); });
  • 48. Facebook für (PHP) Entwickler Wallpost (JS Style) var pageId = 12345678; var post = { message: '', name: 'Der Name des Links', caption: 'Die Beschreibung', link: 'http://www.facebook.com/'+pageId, attribution: 'Meine App' }; FB.api('/'+pageId+'/feed', 'post', post);
  • 49. Facebook für (PHP) Entwickler Wallpost (PHP Style) <?php $pageId = 12345678; $post = array( 'message' => '', 'name' => 'Der Name des Links', 'caption' => 'Die Beschreibung', 'link' => 'http://www.facebook.com/'.$pageId, 'attribution' => 'Meine App' ); $facebook->api('/'.$pageId.'/feed', 'post', $post);