H APPY  F ACEBOOK  D EVELOPER
O UTLINE Self-Introduction  History and Trends The Resource we need to know What Facebook Provide Now What languages We use in this offering  Add Facebook to my site Apps on Facebook.com Mobile apps
SELF-INTRODUCTION Eric Chuang / ddsakura
INTRODUCTION Facebook
H ISTORY   AND  S TATICS 2004/2    Mark Zuckerberg launch Facebook
H ISTORY   AND  S TATICS 2007/10  Facebook reaches over  50 million active users 2004/2    Mark Zuckerberg launch Facebook
H ISTORY   AND  S TATICS 2008/8    Facebook reaches over 100 million active users 2007/10  Facebook reaches over  50 million active users 2004/2    Mark Zuckerberg launch Facebook
H ISTORY   AND  S TATICS 2009/9    Facebook reaches over 300 million active users 2009/2    Facebook reaches over 200 million active users 2008/8    Facebook reaches over 100 million active users 2007/10  Facebook reaches over  50 million active users 2004/2    Mark Zuckerberg launch Facebook
H ISTORY   AND  S TATICS 2010/2    Facebook reaches over 400 million active users 2009/12  Facebook reaches over 350 million active users 2009/9    Facebook reaches over 300 million active users 2009/2    Facebook reaches over 200 million active users 2008/8    Facebook reaches over 100 million active users 2007/10  Facebook reaches over  50 million active users 2004/2    Mark Zuckerberg launch Facebook
H ISTORY   AND  S TATICS 全球有 四億多 會員,台灣則有 650 萬
H ISTORY   AND  S TATICS 有 50% 的會員,每天會造訪 Facebook
H ISTORY   AND  S TATICS 所有會員每個月花超過 5000 億 分鐘在 Facebook 上
H ISTORY   AND  S TATICS Facebook 上有 1.6 億 個物件與會員進行互動
H ISTORY   AND  S TATICS Facebook 有超過 70 種語系 版本
H ISTORY   AND  S TATICS 有約 70% 的 Facebook 會員來自美國以外
H ISTORY   AND  S TATICS 有超過 100 萬 個網站和 Facebook 整合
H ISTORY   AND  S TATICS Facebook 有超過 55 萬 個 Apps
H ISTORY   AND  S TATICS 每月有 70% 的會員用使用 Apps
H ISTORY   AND  S TATICS 有超過 100 萬 的會員透過手機連到 Facebook
H ISTORY   AND  S TATICS
Sony Pictures has released the first trailer for the upcoming movie, “The Social Network”, which is loosely based (sensationalized) on the history of Facebook http://www.thesocialnetwork-movie.com/ http://www.youtube.com/watch?v=mWoUgftTj3Y
The Interface of Facebook
The Interface of Facebook
The Interface of Facebook
The Interface of Facebook
THE RESOURCE WE NEED TO KNOW Facebook
T HE  R ESOURCE  W E   NEED   TO   KNOW Facebook Developer Wiki  http://wiki.developers.facebook.com/index.php/Main_Page Facebook developers Site  http://developers.facebook.com/  Developer Blog http://developers.facebook.com/blog/  All Facebook http://www.allfacebook.com/ Inside Facebook http://www.insidefacebook.com/ http://www.facebook.com/developers/ Tools Firefox Firebug http://developers.facebook.com/tools/
W HAT   LANGUAGES  W E   USE   IN   THIS   OFFERING   Javascript PHP And we will also take a look at Facebook iPhone API
W HAT   LANGUAGES  W E   USE   IN   THIS   OFFERING   But We Don’t discuss the skill for JavaScript, PHP, Objective-C, etc.
Big Event f8 developer conference on April 21, 2010.
W HAT  F ACEBOOK  P ROVIDES  N OW Facebook for Website Apps on Facebook.com Mobile Apps
A DD  F ACEBOOK   TO   MY   WEBSITE Facebook
A DD  F ACEBOOK   TO   MY   WEBSITE Social Plugins Single Sign-on Graph API Open Graph Protocol Analytics Platform showcase
SOCIAL PLUGINS Facebook
S OCIAL  P LUGINS
S OCIAL  P LUGINS The easiest way to get started with Facebook Platform.  We Can Use iframe or XFBML method   Sample Code (iframe) <iframe src=&quot;http://www.facebook.com/widgets/like.php?href= http://example.com &quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;border:none; width:450px; height:80px&quot;></iframe>
Demo
SINGLE SIGN-ON Facebook
Single Sign-on Oauth 2.0 protocol http://tools.ietf.org/html/draft-ietf-oauth-v2-08 http://hueniverse.com/2010/05/introducing-oauth-2-0/  We Can get basically: All general information: like name, profile picture, gender and network. We can get more Ask extended Permisson http://developers.facebook.com/docs/authentication/permissions JavaScript SDK  is a simple way <div id=&quot;fb-root&quot;></div>  <script src=&quot;http://connect.facebook.net/en_US/all.js&quot;></script>  <script> FB.init({appId: ' your app id ', status: true, cookie: true, xfbml: true}); FB.Event.subscribe('auth.sessionChange', function(response) {  if (response.session) { // A user has logged in, and a new cookie has been saved } else { // The user has logged out, and the cookie has been cleared } });  </script>
Single Sign-on How to and Flow Register Our App http://tools.ietf.org/html/draft-ietf-oauth-v2-08 http://hueniverse.com/2010/05/introducing-oauth-2-0/  Redirect the user to https://graph.facebook.com/oauth/authorize with client_id After the user authorizes your application, Facebook redirects the user to the callback URL you specified with the access token in the URL fragment: Use the access token returned by the request above to fetch data from the Graph API on behalf of the user.
Extended Permission Register Our App http://tools.ietf.org/html/draft-ietf-oauth-v2-08 http://hueniverse.com/2010/05/introducing-oauth-2-0/  http://developers.facebook.com/docs/authentication/permissions
GRAPH API Facebook
Register Apps http://www.facebook.com/?ref=logo#!/developers/apps.php
Graph API (1) - get data https://graph.facebook.com/ID
Graph API (2) - get data https://graph.facebook.com/ID/CONNECTION_TYPE
Graph API (3) - selection, Introspection https://graph.facebook.com/ID?fields=A,B,C... https://graph.facebook.com/?ids=XXX,YYY
Graph API (4) POST We can publish to the Facebook graph by issuing HTTP POST requests to the appropriate connection URLs
Graph API (5) Delete We can delete objects in the graph by issuing HTTP DELETE requests to the object DELETE https://graph.facebook.com/ID?access_token=... HTTP/1.1 OR https://graph.facebook.com/COMMENT_ID?method=delete
Graph API (6) Search We can search over all public objects https://graph.facebook.com/search?q=QUERY&type=OBJECT_TYPE For Example All public posts: https://graph.facebook.com/search?q=watermelon&type=post People: https://graph.facebook.com/search?q=mark&type=user Pages: https://graph.facebook.com/search?q=platform&type=page Events: https://graph.facebook.com/search?q=conference&type=event Groups: https://graph.facebook.com/search?q=programming&type=group
Graph API (7) Tool Graph API reference http://developers.facebook.com/docs/reference/api/
Graph API (8) Tools CURL Javascript
OPEN GRAPH PROTOCOL Facebook
Introduction
Introduction – from insidefacebook.com
Getting Start
http://developers.facebook.com/tools/lint/ Tool: URL Linter
Administering our page
Location Meta Data
Analytics http://www.facebook.com/insights/
ShowCase
JAVASCRIPT SDK Facebook
JavaScript SDK(1) The JavaScript SDK enables you to access all of the features of the Graph API via JavaScript The JavaScript SDK is also necessary to use the XFBML  Must register your application. The SDK is open source and is available on http://github.com/facebook/connect-js
JavaScript SDK(2) Core Methods Event Handling XFBML Methods Data Access Utilities Canvas Methods
JavaScript SDK(3) – Core Methods FB.api Make a API call <script> FB.api('/me', function(response) {   console.log(response); }); </script>
JavaScript SDK(4) – Core Methods FB.getLoginStatus Find out the current status from the server, and get a session if the user is connected. <script> FB.getLoginStatus(function(response) {   if (response.session) {     alert('Coneected');   } else {     alert('No Coneected');   } }); </script>
JavaScript SDK(5) – Core Methods FB.login Login/Authorize/Permissions. <button id=&quot;fb-login&quot;>Login</button> <script> document.getElementById('fb-login').onclick = function() {   FB.login(function(response) {     Log.info('FB.login callback', response);     if (response.session) {       Log.info('User is logged in');     } else {       Log.info('User is logged out');     }   }); }; </script>
JavaScript SDK(6) – Core Methods FB.logout Logout the user in the background. <button id=&quot;fb-logout&quot;>Logout</button> <script> document.getElementById('fb-logout').onclick = function() {   FB.logout(function(response) {     alert('logout!');   // user is now logged out   }); }; </script>
JavaScript SDK(7) – Core Methods FB.ui Method for triggering UI interaction with Facebook as IFrame dialogs or popups, like publishing to the stream, sharing links. <script>  var share = {    method: 'stream.share',    u: 'http://www.cht.com.tw/'  };  FB.ui(share, function(response) { console.log(response); }); </script>
JavaScript SDK(8) – Event Handling FB.Event.subscribe Subscribe to a given event name, invoking your callback function whenever the event is fired. <script>  FB.Event.subscribe('auth.sessionChange', function(response)  { // do something with response.session });  </script>
JavaScript SDK(9) – Event Handling FB.Event.unsubscribe Removing a subscriber is basically the same as adding one <script>  var onSessionChange = function(response) { // do something with response.session };  FB.Event.subscribe('auth.sessionChange', onSessionChange);  FB.Event.unsubscribe('auth.sessionChange', onSessionChange);  </script>
JavaScript SDK(10) – Data Access FB.Data.query Removing a subscriber is basically the same as adding one FB.Data.waitOn Wait until the results of all queries are ready <script>  var onSessionChange = function(response) { // do something with response.session };  FB.Event.subscribe('auth.sessionChange', onSessionChange);  FB.Event.unsubscribe('auth.sessionChange', onSessionChange);  </script>
JavaScript SDK(11) - Canvas Methods FB.Canvas.setAutoResize Starts or stops a timer which resizes your iframe every few milliseconds. FB.Canvas.setSize Tells Facebook to resize your iframe.
APPS ON FACEBOOK.COM Facebook
A PPS   ON  F ACEBOOK . COM
ARCHITECTURE Facebook
W HAT  F ACEBOOK  P ROVIDES  N OW FBML Canvas Applications Information Flow
W HAT  F ACEBOOK  P ROVIDES  N OW Websites and IFrame Canvas Applications Information Flow
Register facebook application
Register facebook application -  基本資料
Register facebook application –  驗證 參數 說明 Installable to? 什麼可以使用應用程式,共有兩種選擇,分別是個人檔案和粉絲專頁。 Post-Authorize Callback URL 當使用者第一次新增應用程式後,呼叫的網址。 Post-Remove Callback URL 當使用者移除應用程式後,呼叫的網址。
Register facebook application – 個人檔案 參數 說明 標籤名稱 顯示在個人檔案頁籤的名稱。 標籤網址 當點選頁籤時所載入的網址。 Post-Remove Callback URL 當使用者移除應用程式後,呼叫的網址。
Register facebook application – 個人檔案
Register facebook application – 個人檔案 參數 說明 發佈文字 位於朋友的個人檔案頁面中發佈器所顯示之標題文字。 發佈回呼網址 當在朋友的個人檔案發佈資訊時所呼叫的網址。 自我發佈文字 位於使用者本人的個人檔案頁面中發佈器所顯示之標題文字。 自我發佈回呼網址 當在使用者本人的個人檔案發佈資訊時所呼叫的網址。
Register facebook application –  畫布 參數 說明 畫布頁面網址 設定將應用程式的畫布網址,基本上,這算是應用程式的首頁網址。只要沒有其他應用程式指定的字串,我們可以將該字串設定為畫布網址。 Canvas Callback URL 應用程式真正的網址。 Post-Authorize Redirect URL 當使用者第一次確認應用程式導向的頁面,預設值為畫布頁面網址。 呈現方法 可選則 FBML 或 Iframe 。 IFrame  大小 當選擇 IFrame 時可設定其大小。 畫布寬度 當選擇畫布時可設定其大小。
Authentication Canvas applications use cookies to get user authentication information. The cookie includes a signature for all the values as the argument sig.
Integration Points Stream publishing Requests Bookmarks and Counters Application and Games dashboards Profile tabs
Stram publishing
Request Using FBML tags you can render request forms and friend selectors.
Bookmark, Counters, Game Dashboard, Profile Tab <fb:bookmark></fb:bookmark>
FACEBOOK QUERY LANGUAGE Facebook
FQL(1) Facebook Query Language  Enables we to use a SQL-style interface to query the data https://api.facebook.com/method/fql.query?query=QUERY. Table
FQL(2) – Testing Tool http://developers.facebook.com/docs/reference/rest/fql.query
FQL(3) –   支援基本的運算字 參數 說明 + 加法 - 減法 * 乘法 / 除法 > 大於 < 小於 >= 大於等於 <= 小於等於 = 等於 AND 及 OR 或 NOT 不是
FQL(4) –  支援的函式 參數 說明 now() 取得現在的時間。 rand() 產生亂數。 strlen(string) 計算字串長度。 concat(string, ...) 合併本函式中的所有字串。 substr(string, start, length) 根據字串開始位置 start 和取得長度 length 兩個參數,取得 string 字串的部份文字。 strpos(haystack, needle) 搜尋 haystack 字串,找出該字串中第一次出現 needle 字串的位置,若找不到符合 needle 字串的文字,則回傳 -1 。 lower(string) 將字串轉換成小寫。 upper(string) 將字串轉換成大寫。
FQL(5) – Table :  link_stat Query this table to return detailed information from your Facebook Share implementation SELECT share_count, like_count, comment_count, total_count,click_count FROM link_stat WHERE url=&quot;http://www.yahoo.com&quot;
FQL(6) – Table :  friend Query this table to determine whether two users are linked together as friends. 確認 uid1 跟 uid2 是否為朋友,若雙方不是朋友,將會取得空字串。 select uid1,uid2 from friend where uid1=4 and uid2=5 取得 uid1 的朋友清單 select uid1,uid2 from friend where uid1= 登入者的 UID
FQL(7) – Tables stream SELECT actor_id, message FROM stream WHERE source_id = <user id> limit 5 photo_tag SELECT pid FROM photo_tag WHERE subject=$uid photo SELECT src_big FROM photo WHERE pid IN ( SELECT pid FROM photo_tag WHERE subject=$uid )
FBML Facebook
FBML(1) FBML enables you to build Facebook applications that deeply integrate into a user's Facebook experience.
FBML(2) Tools User/Groups Notifications and Requests Platform Internationalization Status Messages Page Navigation Wall Visibility on Profile Profile-specific Misc Editor Display Embedded Media Dialog Additional Permissions Social Widgets Message Attachments Forms
FBML(3) <fb: 語法名稱 參數一 =&quot; 參數值 &quot;  參數二 =&quot; 參數值 &quot;  ‧‧‧ > 傳入內容 </fb: 語法名稱 >
FBML(4)
FBML(5) http://developers.facebook.com/docs/reference/fbml/ http://developers.facebook.com/tools/console/
FBML(6) <fb:bookmark></fb:bookmark> <fb:comments xid=&quot;titans_comments&quot; canpost=&quot;true&quot; candelete=&quot;false&quot; returnurl=&quot;http://apps.facebook.com/myapp/titans/&quot;></fb:comments>
OLD REST API The old REST API is the previous version of the Graph API.  If we are new to the Facebook Platform, Facebook recommend you use our new Graph API instead. Administrative Methods Login/Auth Methods Data Retrieval Methods Publishing Methods Facebook Connect Methods Mobile Methods Dashboard API Methods Events API Methods Custom Tags API Methods https://api.facebook.com/method/xxxx?access_token=
M OBILE   APPS iPhone SDK Android SDK
M OBILE   APPS - iPhone

More Related Content

PPT
Facebook Connect Integration
PPTX
Facebook and its development
PDF
Turn on the Secure browsing option.
DOCX
Kusursuz perfect-backlink
ODP
Facebook Social Plugins
PDF
Jabber Bot
PPTX
22 Facebook tips
PPTX
Re-using social media data
Facebook Connect Integration
Facebook and its development
Turn on the Secure browsing option.
Kusursuz perfect-backlink
Facebook Social Plugins
Jabber Bot
22 Facebook tips
Re-using social media data

What's hot (19)

PPTX
How I built the demo's
PPTX
Google Its Not Just A Search Engine
PDF
Let the hacking continue - Post Open Hack India Mixer
ODP
How we use Open-source/free software in our Day to day life
PDF
Important information for setting up facebook
PPTX
How to connect social media with open standards
PPTX
The page and the desktop
PDF
Crowdsourcing, Searching Social Media and Curation Resource List
PPT
Open Hack 2008 Mybloglog
PPT
Super searcher2012juneyoungkin
PPT
Facebook 3 1 - jennifer prahl
PDF
With great power comes great responsibility - Microsoft Canada Open Source co...
PPTX
Online policy primer - Facebook
PPTX
WP02 - Windows Phone 7 Deep Dive - How to build apps today
PDF
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
PDF
Software circus: Static websites still got it
PPTX
Facebook Apps Development 101 (Java)
PPT
Social Media for Festivals and Events
KEY
20 things i bet you dont know about social media @ SMC11_ath
How I built the demo's
Google Its Not Just A Search Engine
Let the hacking continue - Post Open Hack India Mixer
How we use Open-source/free software in our Day to day life
Important information for setting up facebook
How to connect social media with open standards
The page and the desktop
Crowdsourcing, Searching Social Media and Curation Resource List
Open Hack 2008 Mybloglog
Super searcher2012juneyoungkin
Facebook 3 1 - jennifer prahl
With great power comes great responsibility - Microsoft Canada Open Source co...
Online policy primer - Facebook
WP02 - Windows Phone 7 Deep Dive - How to build apps today
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Software circus: Static websites still got it
Facebook Apps Development 101 (Java)
Social Media for Festivals and Events
20 things i bet you dont know about social media @ SMC11_ath
Ad

Viewers also liked (9)

PDF
Making Facebook Faster
PDF
Facebook App Development
PPT
Facebook Development with Zend Framework
PDF
Introduction to Facebook Javascript SDK (NEW)
PDF
Workshop : Facebook JavaScript SDK
PDF
Introduction to Facebook JavaScript & Python SDK
PDF
Introduction to facebook java script sdk
PDF
Introduction to facebook javascript sdk
PPT
Facebook + Ruby
Making Facebook Faster
Facebook App Development
Facebook Development with Zend Framework
Introduction to Facebook Javascript SDK (NEW)
Workshop : Facebook JavaScript SDK
Introduction to Facebook JavaScript & Python SDK
Introduction to facebook java script sdk
Introduction to facebook javascript sdk
Facebook + Ruby
Ad

Similar to Happy facebook developer (20)

PPTX
The Face Behind Facebook
ODP
Facebook Platform
PPT
Facebook api
PPT
Facebook API
PPT
Facebook Connect
PPTX
Shiny Agency's Facebook Development Guidelines
PDF
Facebook Platform for Developers
PPT
What's New on the Facebook Platform, May 2011
PPTX
Social mediaprogramming part2-java-jax-london
PPT
The social media developer
PDF
Facebook과 연동하기
PDF
Leveraging Rails to Build Facebook Apps
PPT
Hi5 Open Social
PPTX
Introduction to facebook platform
KEY
23 FACEBOOK APP DEVELOPMENT ESSENTIALS
PPT
Open Social Phpcamp
PPT
Creating a Facebook App
PPT
Whats New On The Facebook Platform Feb 2010 Iskandar
PPT
Ikandar Najmuddin - "What's new?"
PPT
USC Yahoo! BOSS, YAP and YQL Overview
The Face Behind Facebook
Facebook Platform
Facebook api
Facebook API
Facebook Connect
Shiny Agency's Facebook Development Guidelines
Facebook Platform for Developers
What's New on the Facebook Platform, May 2011
Social mediaprogramming part2-java-jax-london
The social media developer
Facebook과 연동하기
Leveraging Rails to Build Facebook Apps
Hi5 Open Social
Introduction to facebook platform
23 FACEBOOK APP DEVELOPMENT ESSENTIALS
Open Social Phpcamp
Creating a Facebook App
Whats New On The Facebook Platform Feb 2010 Iskandar
Ikandar Najmuddin - "What's new?"
USC Yahoo! BOSS, YAP and YQL Overview

More from Yu-Wei Chuang (9)

PDF
Android N multi window
PDF
When Web meet Native App
PDF
About Mobile Web Development Thing
PDF
Ff os app demo
PDF
Mojito 開發 mobile web 實戰經驗談
PDF
Mojito@nodejstw
PPTX
Cocktails – Shaken, Not Stirred @osdc.tw
PPT
Google Ajax APIs
PDF
Google AJAX APIs
Android N multi window
When Web meet Native App
About Mobile Web Development Thing
Ff os app demo
Mojito 開發 mobile web 實戰經驗談
Mojito@nodejstw
Cocktails – Shaken, Not Stirred @osdc.tw
Google Ajax APIs
Google AJAX APIs

Recently uploaded (20)

PDF
The influence of sentiment analysis in enhancing early warning system model f...
PDF
CloudStack 4.21: First Look Webinar slides
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Flame analysis and combustion estimation using large language and vision assi...
PDF
Getting started with AI Agents and Multi-Agent Systems
PPT
Geologic Time for studying geology for geologist
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
Configure Apache Mutual Authentication
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PPTX
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
Microsoft Excel 365/2024 Beginner's training
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Architecture types and enterprise applications.pdf
PDF
sbt 2.0: go big (Scala Days 2025 edition)
The influence of sentiment analysis in enhancing early warning system model f...
CloudStack 4.21: First Look Webinar slides
Enhancing emotion recognition model for a student engagement use case through...
Flame analysis and combustion estimation using large language and vision assi...
Getting started with AI Agents and Multi-Agent Systems
Geologic Time for studying geology for geologist
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
Taming the Chaos: How to Turn Unstructured Data into Decisions
OpenACC and Open Hackathons Monthly Highlights July 2025
Developing a website for English-speaking practice to English as a foreign la...
Hindi spoken digit analysis for native and non-native speakers
Configure Apache Mutual Authentication
A contest of sentiment analysis: k-nearest neighbor versus neural network
Credit Without Borders: AI and Financial Inclusion in Bangladesh
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
A comparative study of natural language inference in Swahili using monolingua...
Microsoft Excel 365/2024 Beginner's training
1 - Historical Antecedents, Social Consideration.pdf
Architecture types and enterprise applications.pdf
sbt 2.0: go big (Scala Days 2025 edition)

Happy facebook developer

  • 1. H APPY F ACEBOOK D EVELOPER
  • 2. O UTLINE Self-Introduction History and Trends The Resource we need to know What Facebook Provide Now What languages We use in this offering Add Facebook to my site Apps on Facebook.com Mobile apps
  • 5. H ISTORY AND S TATICS 2004/2    Mark Zuckerberg launch Facebook
  • 6. H ISTORY AND S TATICS 2007/10  Facebook reaches over  50 million active users 2004/2    Mark Zuckerberg launch Facebook
  • 7. H ISTORY AND S TATICS 2008/8    Facebook reaches over 100 million active users 2007/10  Facebook reaches over  50 million active users 2004/2    Mark Zuckerberg launch Facebook
  • 8. H ISTORY AND S TATICS 2009/9    Facebook reaches over 300 million active users 2009/2    Facebook reaches over 200 million active users 2008/8    Facebook reaches over 100 million active users 2007/10  Facebook reaches over  50 million active users 2004/2    Mark Zuckerberg launch Facebook
  • 9. H ISTORY AND S TATICS 2010/2    Facebook reaches over 400 million active users 2009/12  Facebook reaches over 350 million active users 2009/9    Facebook reaches over 300 million active users 2009/2    Facebook reaches over 200 million active users 2008/8    Facebook reaches over 100 million active users 2007/10  Facebook reaches over  50 million active users 2004/2    Mark Zuckerberg launch Facebook
  • 10. H ISTORY AND S TATICS 全球有 四億多 會員,台灣則有 650 萬
  • 11. H ISTORY AND S TATICS 有 50% 的會員,每天會造訪 Facebook
  • 12. H ISTORY AND S TATICS 所有會員每個月花超過 5000 億 分鐘在 Facebook 上
  • 13. H ISTORY AND S TATICS Facebook 上有 1.6 億 個物件與會員進行互動
  • 14. H ISTORY AND S TATICS Facebook 有超過 70 種語系 版本
  • 15. H ISTORY AND S TATICS 有約 70% 的 Facebook 會員來自美國以外
  • 16. H ISTORY AND S TATICS 有超過 100 萬 個網站和 Facebook 整合
  • 17. H ISTORY AND S TATICS Facebook 有超過 55 萬 個 Apps
  • 18. H ISTORY AND S TATICS 每月有 70% 的會員用使用 Apps
  • 19. H ISTORY AND S TATICS 有超過 100 萬 的會員透過手機連到 Facebook
  • 20. H ISTORY AND S TATICS
  • 21. Sony Pictures has released the first trailer for the upcoming movie, “The Social Network”, which is loosely based (sensationalized) on the history of Facebook http://www.thesocialnetwork-movie.com/ http://www.youtube.com/watch?v=mWoUgftTj3Y
  • 22. The Interface of Facebook
  • 23. The Interface of Facebook
  • 24. The Interface of Facebook
  • 25. The Interface of Facebook
  • 26. THE RESOURCE WE NEED TO KNOW Facebook
  • 27. T HE R ESOURCE W E NEED TO KNOW Facebook Developer Wiki  http://wiki.developers.facebook.com/index.php/Main_Page Facebook developers Site  http://developers.facebook.com/  Developer Blog http://developers.facebook.com/blog/  All Facebook http://www.allfacebook.com/ Inside Facebook http://www.insidefacebook.com/ http://www.facebook.com/developers/ Tools Firefox Firebug http://developers.facebook.com/tools/
  • 28. W HAT LANGUAGES W E USE IN THIS OFFERING Javascript PHP And we will also take a look at Facebook iPhone API
  • 29. W HAT LANGUAGES W E USE IN THIS OFFERING But We Don’t discuss the skill for JavaScript, PHP, Objective-C, etc.
  • 30. Big Event f8 developer conference on April 21, 2010.
  • 31. W HAT F ACEBOOK P ROVIDES N OW Facebook for Website Apps on Facebook.com Mobile Apps
  • 32. A DD F ACEBOOK TO MY WEBSITE Facebook
  • 33. A DD F ACEBOOK TO MY WEBSITE Social Plugins Single Sign-on Graph API Open Graph Protocol Analytics Platform showcase
  • 35. S OCIAL P LUGINS
  • 36. S OCIAL P LUGINS The easiest way to get started with Facebook Platform. We Can Use iframe or XFBML method  Sample Code (iframe) <iframe src=&quot;http://www.facebook.com/widgets/like.php?href= http://example.com &quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;border:none; width:450px; height:80px&quot;></iframe>
  • 37. Demo
  • 39. Single Sign-on Oauth 2.0 protocol http://tools.ietf.org/html/draft-ietf-oauth-v2-08 http://hueniverse.com/2010/05/introducing-oauth-2-0/ We Can get basically: All general information: like name, profile picture, gender and network. We can get more Ask extended Permisson http://developers.facebook.com/docs/authentication/permissions JavaScript SDK is a simple way <div id=&quot;fb-root&quot;></div> <script src=&quot;http://connect.facebook.net/en_US/all.js&quot;></script> <script> FB.init({appId: ' your app id ', status: true, cookie: true, xfbml: true}); FB.Event.subscribe('auth.sessionChange', function(response) { if (response.session) { // A user has logged in, and a new cookie has been saved } else { // The user has logged out, and the cookie has been cleared } }); </script>
  • 40. Single Sign-on How to and Flow Register Our App http://tools.ietf.org/html/draft-ietf-oauth-v2-08 http://hueniverse.com/2010/05/introducing-oauth-2-0/ Redirect the user to https://graph.facebook.com/oauth/authorize with client_id After the user authorizes your application, Facebook redirects the user to the callback URL you specified with the access token in the URL fragment: Use the access token returned by the request above to fetch data from the Graph API on behalf of the user.
  • 41. Extended Permission Register Our App http://tools.ietf.org/html/draft-ietf-oauth-v2-08 http://hueniverse.com/2010/05/introducing-oauth-2-0/ http://developers.facebook.com/docs/authentication/permissions
  • 44. Graph API (1) - get data https://graph.facebook.com/ID
  • 45. Graph API (2) - get data https://graph.facebook.com/ID/CONNECTION_TYPE
  • 46. Graph API (3) - selection, Introspection https://graph.facebook.com/ID?fields=A,B,C... https://graph.facebook.com/?ids=XXX,YYY
  • 47. Graph API (4) POST We can publish to the Facebook graph by issuing HTTP POST requests to the appropriate connection URLs
  • 48. Graph API (5) Delete We can delete objects in the graph by issuing HTTP DELETE requests to the object DELETE https://graph.facebook.com/ID?access_token=... HTTP/1.1 OR https://graph.facebook.com/COMMENT_ID?method=delete
  • 49. Graph API (6) Search We can search over all public objects https://graph.facebook.com/search?q=QUERY&type=OBJECT_TYPE For Example All public posts: https://graph.facebook.com/search?q=watermelon&type=post People: https://graph.facebook.com/search?q=mark&type=user Pages: https://graph.facebook.com/search?q=platform&type=page Events: https://graph.facebook.com/search?q=conference&type=event Groups: https://graph.facebook.com/search?q=programming&type=group
  • 50. Graph API (7) Tool Graph API reference http://developers.facebook.com/docs/reference/api/
  • 51. Graph API (8) Tools CURL Javascript
  • 54. Introduction – from insidefacebook.com
  • 62. JavaScript SDK(1) The JavaScript SDK enables you to access all of the features of the Graph API via JavaScript The JavaScript SDK is also necessary to use the XFBML Must register your application. The SDK is open source and is available on http://github.com/facebook/connect-js
  • 63. JavaScript SDK(2) Core Methods Event Handling XFBML Methods Data Access Utilities Canvas Methods
  • 64. JavaScript SDK(3) – Core Methods FB.api Make a API call <script> FB.api('/me', function(response) {   console.log(response); }); </script>
  • 65. JavaScript SDK(4) – Core Methods FB.getLoginStatus Find out the current status from the server, and get a session if the user is connected. <script> FB.getLoginStatus(function(response) {   if (response.session) {     alert('Coneected');   } else {     alert('No Coneected');   } }); </script>
  • 66. JavaScript SDK(5) – Core Methods FB.login Login/Authorize/Permissions. <button id=&quot;fb-login&quot;>Login</button> <script> document.getElementById('fb-login').onclick = function() {   FB.login(function(response) {     Log.info('FB.login callback', response);     if (response.session) {       Log.info('User is logged in');     } else {       Log.info('User is logged out');     }   }); }; </script>
  • 67. JavaScript SDK(6) – Core Methods FB.logout Logout the user in the background. <button id=&quot;fb-logout&quot;>Logout</button> <script> document.getElementById('fb-logout').onclick = function() {   FB.logout(function(response) {     alert('logout!');   // user is now logged out   }); }; </script>
  • 68. JavaScript SDK(7) – Core Methods FB.ui Method for triggering UI interaction with Facebook as IFrame dialogs or popups, like publishing to the stream, sharing links. <script>  var share = {    method: 'stream.share',    u: 'http://www.cht.com.tw/'  };  FB.ui(share, function(response) { console.log(response); }); </script>
  • 69. JavaScript SDK(8) – Event Handling FB.Event.subscribe Subscribe to a given event name, invoking your callback function whenever the event is fired. <script> FB.Event.subscribe('auth.sessionChange', function(response) { // do something with response.session }); </script>
  • 70. JavaScript SDK(9) – Event Handling FB.Event.unsubscribe Removing a subscriber is basically the same as adding one <script> var onSessionChange = function(response) { // do something with response.session }; FB.Event.subscribe('auth.sessionChange', onSessionChange); FB.Event.unsubscribe('auth.sessionChange', onSessionChange); </script>
  • 71. JavaScript SDK(10) – Data Access FB.Data.query Removing a subscriber is basically the same as adding one FB.Data.waitOn Wait until the results of all queries are ready <script> var onSessionChange = function(response) { // do something with response.session }; FB.Event.subscribe('auth.sessionChange', onSessionChange); FB.Event.unsubscribe('auth.sessionChange', onSessionChange); </script>
  • 72. JavaScript SDK(11) - Canvas Methods FB.Canvas.setAutoResize Starts or stops a timer which resizes your iframe every few milliseconds. FB.Canvas.setSize Tells Facebook to resize your iframe.
  • 74. A PPS ON F ACEBOOK . COM
  • 76. W HAT F ACEBOOK P ROVIDES N OW FBML Canvas Applications Information Flow
  • 77. W HAT F ACEBOOK P ROVIDES N OW Websites and IFrame Canvas Applications Information Flow
  • 80. Register facebook application – 驗證 參數 說明 Installable to? 什麼可以使用應用程式,共有兩種選擇,分別是個人檔案和粉絲專頁。 Post-Authorize Callback URL 當使用者第一次新增應用程式後,呼叫的網址。 Post-Remove Callback URL 當使用者移除應用程式後,呼叫的網址。
  • 81. Register facebook application – 個人檔案 參數 說明 標籤名稱 顯示在個人檔案頁籤的名稱。 標籤網址 當點選頁籤時所載入的網址。 Post-Remove Callback URL 當使用者移除應用程式後,呼叫的網址。
  • 82. Register facebook application – 個人檔案
  • 83. Register facebook application – 個人檔案 參數 說明 發佈文字 位於朋友的個人檔案頁面中發佈器所顯示之標題文字。 發佈回呼網址 當在朋友的個人檔案發佈資訊時所呼叫的網址。 自我發佈文字 位於使用者本人的個人檔案頁面中發佈器所顯示之標題文字。 自我發佈回呼網址 當在使用者本人的個人檔案發佈資訊時所呼叫的網址。
  • 84. Register facebook application – 畫布 參數 說明 畫布頁面網址 設定將應用程式的畫布網址,基本上,這算是應用程式的首頁網址。只要沒有其他應用程式指定的字串,我們可以將該字串設定為畫布網址。 Canvas Callback URL 應用程式真正的網址。 Post-Authorize Redirect URL 當使用者第一次確認應用程式導向的頁面,預設值為畫布頁面網址。 呈現方法 可選則 FBML 或 Iframe 。 IFrame 大小 當選擇 IFrame 時可設定其大小。 畫布寬度 當選擇畫布時可設定其大小。
  • 85. Authentication Canvas applications use cookies to get user authentication information. The cookie includes a signature for all the values as the argument sig.
  • 86. Integration Points Stream publishing Requests Bookmarks and Counters Application and Games dashboards Profile tabs
  • 88. Request Using FBML tags you can render request forms and friend selectors.
  • 89. Bookmark, Counters, Game Dashboard, Profile Tab <fb:bookmark></fb:bookmark>
  • 91. FQL(1) Facebook Query Language Enables we to use a SQL-style interface to query the data https://api.facebook.com/method/fql.query?query=QUERY. Table
  • 92. FQL(2) – Testing Tool http://developers.facebook.com/docs/reference/rest/fql.query
  • 93. FQL(3) – 支援基本的運算字 參數 說明 + 加法 - 減法 * 乘法 / 除法 > 大於 < 小於 >= 大於等於 <= 小於等於 = 等於 AND 及 OR 或 NOT 不是
  • 94. FQL(4) – 支援的函式 參數 說明 now() 取得現在的時間。 rand() 產生亂數。 strlen(string) 計算字串長度。 concat(string, ...) 合併本函式中的所有字串。 substr(string, start, length) 根據字串開始位置 start 和取得長度 length 兩個參數,取得 string 字串的部份文字。 strpos(haystack, needle) 搜尋 haystack 字串,找出該字串中第一次出現 needle 字串的位置,若找不到符合 needle 字串的文字,則回傳 -1 。 lower(string) 將字串轉換成小寫。 upper(string) 將字串轉換成大寫。
  • 95. FQL(5) – Table : link_stat Query this table to return detailed information from your Facebook Share implementation SELECT share_count, like_count, comment_count, total_count,click_count FROM link_stat WHERE url=&quot;http://www.yahoo.com&quot;
  • 96. FQL(6) – Table : friend Query this table to determine whether two users are linked together as friends. 確認 uid1 跟 uid2 是否為朋友,若雙方不是朋友,將會取得空字串。 select uid1,uid2 from friend where uid1=4 and uid2=5 取得 uid1 的朋友清單 select uid1,uid2 from friend where uid1= 登入者的 UID
  • 97. FQL(7) – Tables stream SELECT actor_id, message FROM stream WHERE source_id = <user id> limit 5 photo_tag SELECT pid FROM photo_tag WHERE subject=$uid photo SELECT src_big FROM photo WHERE pid IN ( SELECT pid FROM photo_tag WHERE subject=$uid )
  • 99. FBML(1) FBML enables you to build Facebook applications that deeply integrate into a user's Facebook experience.
  • 100. FBML(2) Tools User/Groups Notifications and Requests Platform Internationalization Status Messages Page Navigation Wall Visibility on Profile Profile-specific Misc Editor Display Embedded Media Dialog Additional Permissions Social Widgets Message Attachments Forms
  • 101. FBML(3) <fb: 語法名稱 參數一 =&quot; 參數值 &quot; 參數二 =&quot; 參數值 &quot; ‧‧‧ > 傳入內容 </fb: 語法名稱 >
  • 104. FBML(6) <fb:bookmark></fb:bookmark> <fb:comments xid=&quot;titans_comments&quot; canpost=&quot;true&quot; candelete=&quot;false&quot; returnurl=&quot;http://apps.facebook.com/myapp/titans/&quot;></fb:comments>
  • 105. OLD REST API The old REST API is the previous version of the Graph API. If we are new to the Facebook Platform, Facebook recommend you use our new Graph API instead. Administrative Methods Login/Auth Methods Data Retrieval Methods Publishing Methods Facebook Connect Methods Mobile Methods Dashboard API Methods Events API Methods Custom Tags API Methods https://api.facebook.com/method/xxxx?access_token=
  • 106. M OBILE APPS iPhone SDK Android SDK
  • 107. M OBILE APPS - iPhone

Editor's Notes

  • #6: Facebook 的創辦人是 馬克 · 扎克伯格 ( Mark Zuckerberg ),他是 哈佛大學 的學生,之前畢業於 阿茲利高中 (英語: Ardsley High School )。 Facebook 的名字是來自傳統的紙質「花名冊」,通常美國的大學和預科學校把這種印有學校社區所有成員的「花名冊」發放給新入學或入職的學生和教職 員,協助大家認識學校內其他成員。最初, Facebook 的註冊僅限於 哈佛學院 的學生,在隨後的兩個月內,註冊擴展至 波士頓 地區的其他高校(如 麻省理工學院 )以及 史丹福大學 、 紐約大學 、 西北大學 和所有的 長春藤名校 。第二年,很多其他學校也被邀請加入。最終,在全球範圍內有 一個大學後綴電子郵箱的人(如 .edu, .ac.uk 等)都可以註冊。之後,在 Facebook 中也可以建立起高中和公司的社會化網路。而從 2006 年 9 月 11 日起,任何用戶輸入有效電子郵件位 址都可申請。用戶可以選擇加入一個或以上網路,例如中學的、公司的、或地區。 [6]