Facebook für PHP Entwickler - phpugffm
Upcoming SlideShare
Loading in...5
×
 

Facebook für PHP Entwickler - phpugffm

on

  • 3,623 views

 

Statistics

Views

Total Views
3,623
Views on SlideShare
3,623
Embed Views
0

Actions

Likes
2
Downloads
4
Comments
3

0 Embeds 0

No embeds

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

13 of 3 Post a comment

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

    Facebook für PHP Entwickler - phpugffm Facebook für PHP Entwickler - phpugffm Presentation Transcript

    • 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 Integrationhttps://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 socialgraph, uniformly representing objects inthe 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 Tabellenalbum, 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!