Facebook Developer APIsAndrew SorensenUniversity of Washington | Tacoma
API TypesFacebook presents its APIs based on the typeof application you want to build:● For Websites● For Mobile● Apps on Facebook developers.facebook.com
Facebook for Websites1. Enables sharing & collaboration of rich media (use opengraph tags!)2. Social engagement (friends/community at large actions)3. Authentication - users dont want another login (SSO).4. Personalization (access user information)
Facebook for Mobile1. Login & Requests2. Sharing from other applications (From Facebook UI or via SDK)3. Bookmarks to user installed on-device applications within Facebook4. PaymentsThese can be developed via a nativeapplication (w/ OS specific SDK) or via a webapplication.
Apps on Facebook● Embedded on Facebook website: existing webpage displayed within facebook chrome (iframe).● Interaction with Facebook UI (like Notifications)● Facebook analytics
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
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.
Writing your own SDK● If you want to write your own classes to interact with the webservice, youll 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!
My Advice1. Dont 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 - dont 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.
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.