Facebook Apps: Ein Entwicklungsleitfaden - WMMRN

  • 1,995 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,995
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
14
Comments
0
Likes
2

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Facebook Apps:Ein Entwicklungsleitfaden
  • 2. Facebook Apps: Entwicklungsleitfaden Über mich  Stephan Hochdörfer, bitExpert AG  Department Manager Research Labs  S.Hochdoerfer@bitExpert.de  @shochdoerfer  http://www.facebook.com/shochdoerfer
  • 3. Facebook Apps: Entwicklungsleitfaden Damals: Umfangreiches Ökosystem
  • 4. Facebook Apps: Entwicklungsleitfaden Heute: Die Graph API
  • 5. Facebook Apps: Entwicklungsleitfaden Die Graph API: REST https://graph.facebook.com/1047746467
  • 6. Facebook Apps: Entwicklungsleitfaden Die Graph API: REST + JSON{ "id": "1047746467", "name": "Stephan Hochdoerfer", "first_name": "Stephan", "last_name": "Hochdoerfer", "link": "https://www.facebook.com/shochdoerfer", "username": "shochdoerfer", "gender": "male", "locale": "de_DE"}
  • 7. Facebook Apps: Entwicklungsleitfaden /me/friends?access_token=
  • 8. Facebook Apps: Entwicklungsleitfaden Die erste Facebook App
  • 9. Facebook Apps: Entwicklungsleitfaden Die erste Facebook App <!DOCTYPE html> <html xmlns:fb="https://www.facebook.com/2008/fbml"> <body> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId: your app id, status: true, cookie: true, xfbml: true }); }; (function() { var e = document.createElement(script); e.async = true; e.src = document.location.protocol+//connect.facebook.net/en_US/all.js; document.getElementById(fb-root).appendChild(e); }()); </script> </body> <html>
  • 10. Facebook Apps: Entwicklungsleitfaden
  • 11. Facebook Apps: Entwicklungsleitfaden
  • 12. Facebook Apps: Entwicklungsleitfaden Fan oder Nicht Fan? <?php $request = $facebook->getSignedRequest(); $isFan = isset($request[page]) && isset($request[page][liked]); ?>
  • 13. Facebook Apps: Entwicklungsleitfaden Login / Authentifzierung FB.getLoginStatus(function(response) { if (response.session) { // User eingeloggt } else { // Versuchen den User einzuloggen FB.login(function(response) { if(response.session) { if(response.perms) { // ist eingeloggt.... } } }, { perms: publish_stream, offline_access }); } });
  • 14. Facebook Apps: Entwicklungsleitfaden 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);
  • 15. Facebook Apps: Entwicklungsleitfaden 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);
  • 16. Facebook Apps: Entwicklungsleitfaden FQL enables you to use a SQL-style interface to query the data exposed by the Graph API.
  • 17. Facebook Apps: Entwicklungsleitfaden 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); });
  • 18. 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); });
  • 19. Vielen Dank!