13
Facebook Developer APIs Andrew Sorensen University of Washington | Tacoma

Facebook APIs

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Facebook APIs

Facebook Developer APIs

Andrew SorensenUniversity of Washington | Tacoma

Page 2: Facebook APIs

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

Page 3: Facebook APIs

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

Page 4: Facebook APIs

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.

Page 5: Facebook APIs

Apps on Facebook● Embedded on Facebook website: existing

webpage displayed within facebook chrome (iframe).

● Interaction with Facebook UI (like Notifications)

● Facebook analytics

Page 6: Facebook APIs

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.

Page 7: Facebook APIs

Offical SDKs1. JavaScript: (Rest, Graph API, Dialogs).2. PHP SDK3. iOS4. Android SDK

Page 8: Facebook APIs

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

Page 9: Facebook APIs

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.

Page 10: Facebook APIs

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!

Page 11: Facebook APIs

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.

Page 12: Facebook APIs

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.

Page 13: Facebook APIs

Questions?https://students.washington.edu/andrewx/