Upload
andrew-sorensen
View
408
Download
0
Embed Size (px)
DESCRIPTION
Citation preview
Facebook Developer APIs
Andrew SorensenUniversity of Washington | Tacoma
API TypesFacebook presents its' APIs based on the type of application you want to build:
● For Websites● For Mobile● Apps on Facebook
developers.facebook.com
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)
Facebook for Websites
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. Payments
These can be developed via a native application (w/ OS specific SDK) or via a web application.
Apps on Facebook● Embedded on Facebook website: existing
webpage displayed within facebook chrome (iframe).
● Interaction with Facebook UI (like Notifications)
● Facebook analytics
Using the APIs1. 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.
Offical SDKs1. JavaScript: (Rest, Graph API, Dialogs).2. PHP SDK3. iOS4. Android SDK
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, 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!
My Advice1. 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.
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.
Questions?https://students.washington.edu/andrewx/