Facebook Dev Tools

ways to bootstrap your hack

Adam Gross

Production Engineer on Platform

what might help my hack?

let's go over a few tools at your disposal...

Facebook Login

personalize the experience

Don't waste precious hack time by writing
a login system from scratch.

We have libraries for nearly all platforms and languages, making it easy to use Facebook (and Login) within your app.

We're using the Javascript SDK in this presentation.

Logged Out View

Show the FB Login button, since the user isn't logged in.

Logged In View

The user is logged in! You can immediately access the current user's ID and profile pic. Your app can save this ID to your backend to identify returning users.

Uninstall the app to log out: App Settings

Graph API

Why create fake data to put in your app when you can use the real stuff instead?

Read from the graph: newsfeed, check-ins, photos, music listens, messages, events, liked movies/books/sports, friends (and more)

Write to the graph: make status updates, upload photos and videos, add a check-in, create events (and more)

Demo: Members of the Stanford HackingHours Facebook Group

FB.api(
  '//members?fields=picture,name',
  function(response) {
    /* Here's where you handle the response.
     * To inspect this call in the API explorer 
     */
  }
);

Demo: Recent Music Listens

FB.api(
  '/me/music.listens',
  function(response) {
    /* Here's where you handle the response.
     * Be sure user_actions.music is in your access token!
     * To inspect this call in the API explorer click here.
     */
  }
);

Social Plugins

copy and paste widgets for easy interaction

this is live btw, not a screenshot.
go on and add a comment →

Notifications

alert users via notifications just don't spam plz

tl;dr

Facebook Login = personalize the experience

Graph API = get real data (judges can actually try your app!)

Social Plugins + Notifications = integrate with Facebook

Live demo at adamgross42.github.io/fbapidemo — Source code at github.com/adamgross42/fbapidemo