Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Facebook Platform For .net Developers

Lidan
February 06, 2011

Facebook Platform For .net Developers

Lidan

February 06, 2011
Tweet

More Decks by Lidan

Other Decks in Programming

Transcript

  1. Agenda Introduction to facebook platform Facebook architecture, Platform components Enhancing

    facebook pages with FBML Using Static FBML Application Facebook for Websites Open Graph Protocol, Social Plugins Facebook apps development With ASP.NET MVC & Social Graph API
  2. 20 Minutes on facebook... 1,000,000 1,484,000 1,972,000 2,716,000 2,716,000 1,323,000

    1,851,000 1,587,000 10,208,000 LINKS SHARED TAGGED PHOTOS EVENT INVITES STATUS UPDATES WALL POSTS COMMENTS MADE FRIEND REQUESTS ACCEPTED PHOTOS UPLOADED MESSAGES SENT
  3. 20 Minutes on facebook... 500 GB of data every 20

    minutes! ~36 TB/day ~13 PB/year
  4. facebook platform- why? of facebook users engaged with facebook applications

    every day More than 70% facebook users engaged with facebook on 2.5M websites every month More than 250M facebook users accessing facebook through their mobile devices every day More than 200M
  5. What’s needed? Be admin of your facebook page Install Static

    FBML Application Add FBML Tabs with static content
  6. Before getting started... Max width is 520px You cannot auto

    run JavaScript in FBML tab Use FBJS Use external CSS file instead of <style> tag 6 Tabs maximum facebook pages only
  7. FBML >fb:swf imgstyle="border-width: 3px; border-color: white;” swfsrc="http://www.youtube.com/v/CfMGFHiTKLY” imgsrc="http://i4.ytimg.com/vi/CfMGFHiTKLY/default.jpg” width="480” height="390”

    /> >fb:user-agent includes="ie 6, ie 7”> <link rel="stylesheet” href="ie.css” /> </fb:user-agent> FBML Documentation is available at: http://developers.facebook.com/docs/reference/fbml Remember that FBML is deprecated
  8. What user likes in the real-world Based off of the

    most popular categories for Facebook Pages Activities Businesses Groups Organizations People Places Products and Entertainment Websites company, restaurant sports_team, cause band, government musician, actor city, country book, movie, tv_show website, blog, article
  9. Implementing the Open Graph >html xmlns="http://www.w3.org/1999/xhtml”> <head> <title> The Social

    Network (2010) </title> </head> >html xmlns="http://www.w3.org/1999/xhtml” xmlns:og=“http://ogp.me/ns#” xmlns:fb="http://www.facebook.com/2008/fbml”> <head> <title> The Social Network (2010) </title> </head> >html xmlns="http://www.w3.org/1999/xhtml” xmlns:og=“http://ogp.me/ns#” xmlns:fb="http://www.facebook.com/2008/fbml”> <head> <title> The Social Network (2010) </title> <meta property="og:title” content="The Social Network” /> <meta property="og:type” content="Movie” /> <meta property="og:url” content="http://www.imdb.com/897” /> <meta property="og:image” content="http://www.imdb.com/897/theSocialNetwork.jpg” /> </head>
  10. Social Plugins Let user see what his friends have liked,

    commented on or shared across the web Provides integration between facebook platform and your website
  11. Like Box Enable users to like your facebook page and

    view its stream directly from your website
  12. Demo Like Box Generate code for all of the social

    plugins at: http://developers.facebook.com/docs/plugins
  13. Like Button Lets users share pages from your site back

    to their facebook profile with one click
  14. Advanced plugins Create a new facebook application Setup a new

    application at: http://developers.facebook.com/setup
  15. Login & Registration Allows users to easily sign up for

    your website with their facebook account
  16. 698752998 Objects https://graph.facebook.com/ lidan { id: "698752998“, name: "Lidan Hifi“,

    first_name: "Lidan“, last_name: "Hifi“, link: "http://www.facebook.com/lidan", birthday: "04/27/1988“, location: { id: "113187025363265“, name: "Be'Er Sheva`, Hadarom, Israel" }, gender: "male“ } Unique ID
  17. 698752998 Relationships https://graph.facebook.com/ {id: "698752998_187701601241105“, from: { name: "Lidan Hifi“,

    id: "698752998" } message: " האלמ הנש םישנאל לחאל לוכי ולש תואיגש ןוקיתה םע ילש ןופלטה קר תויווחב האלמ הנש םוקמב תויוולב "... ,- privacy: { description: "Friends Only; “, value: "CUSTOM“, friends: "ALL_FRIENDS" }, type: "status“, created_time: "2011-01-02T13:05:10+0000“, likes: 5 } /feed
  18. Authentication OAuth 2.0-based authentication https://graph.facebook.com/me?access_token=2227470867|2.v UgGGAgEL6yF_LEYygniXA__.3600.1296417600698752998|rlW FrcgmkEVVKd7aYi3bKjNZ1gU Permissions You must

    request specific permissions from the user read_stream, publish_stream, user_photos, user_checkins, user_location, offline_access https://www.facebook.com/dialog/oauth?client_id=114587458 &redirect_uri=http://www.lidans.com https://www.facebook.com/dialog/oauth?client_id=114587458 &redirect_uri=http://www.lidans.com https://www.facebook.com/dialog/oauth?client_id=114587458 &redirect_uri=http://www.lidans.com
  19. Publishing HTTP POST https://graph.facebook.com/18754916/attending HTTP POST https://graph.facebook.com/lidan/feed { message: ‘Hi,

    Do you like the graph API?’ } HTTP POST https://graph.facebook.com/lidan/checkins { coordinates: { 32.175876, 34.889177 }, place: 149111711803941, message: ‘playing with the graph API at Microsoft Israel’ }
  20. How facebook app works user Application server User Request HTML

    Response API Call API Response Request For application Response For application 1 2 3 4 5 6
  21. Web Server Valid domain or IP (NO localhost) Facebook SDK

    Application  Application Id  API Key  AppSecret What’s needed?
  22. Facebook applications Setup a new facebook application Setup a new

    application at: http://www.facebook.com/developers