2. API Types
Facebook presents its' APIs based on the type
of application you want to build:
● For Websites
● For Mobile
● Apps on Facebook
developers.facebook.com
3. Facebook for Websites
1. Enables sharing & collaboration of rich
media (use opengraph tags!)
2. Social engagement (friends/community at
large actions)
3. Authentication - users don't want another
login (SSO).
4. Personalization (access user information)
4. Facebook for Mobile
1. Login & Requests
2. Sharing from other applications (From
Facebook UI or via SDK)
3. Bookmarks to user installed on-device
applications within Facebook
4. Payments
These can be developed via a native
application (w/ OS specific SDK) or via a web
application.
5. Apps on Facebook
● Embedded on Facebook website: existing
webpage displayed within facebook chrome
(iframe).
● Interaction with Facebook UI (like
Notifications)
● Facebook analytics
6. Using the APIs
1. Use the provided widgets/dialogs (via
javascript/iframe) with appropriate HTML
markup (OpenGraph metadata properties).
2. Use an [un]offical SDK to Facebook's
webservices.
3. Use the webservice (OpenGraph, REST)
directly.
8. OAuth
● Sharing passwords with a service is over
● Request the permissions you need - users
have to approve your application.
● Avoid implementing your own OAuth library
9. Why use an SDK?
1. Avoids dealing with webservice directly,
decreasing tight technology coupling.
2. Avoid writing unit tests for the webservice
(tests are frequently provided with SDKs).
3. API Updates are easier to deal with.
10. Writing your own SDK
● If you want to write your own classes to
interact with the webservice, you'll need to
support the Facebook Query Language
(FQL).
● Stay away from the REST api, as it is
depreciated.
● Both the REST and FQL APIs use the OAuth
workflow.
● Make sure you really have the need to
create your own SDK before doing it!
11. My Advice
1. Don't rely on facebook (or any 3rd party
service) too heavily - they *will* have
downtime.
2. Facebook is the next "Myspace"
3. Keep your secrets secret - don't share
authentication tokens/secrets.
4. Make sure your SDK is frequently updated &
make sure you stay on the newest version.
5. Handle all exceptions - they will be thrown.
12. Where to go from here
● Read the api documentation (developers.
facebook.com)
● Check out existing SDKs for your language
(like restfb for Java).
● Look at how other websites/apps integrate
with Facebook.