By Zainab Ghadiyali (Facebook software engineer & Hackbright mentor)
With over 1 billion monthly active users and 819 million mobile monthly active users, Facebook Platform is a terrific way to make your website or app more social. It allows users to publish to Open Graph stories from every platform on which your app exists, and share those stories with their friends, no matter what platform they’re using. When you use Facebook Login to sign in users with their real identities, calling the Graph API and using Open Graph to tell stories, your users will be more engaged and more likely to return.
The Graph API follows a simple HTTP request based model. A user performs an action which are you can post by HTTP request to Facebook. Facebook then fetches the object’s metadata and uses it to construct a story on Facebook. The process for using the Graph API is quite simple. First, model your data in way that best narrates your user’s story. What do your users do? Do they watch? Cook? Run? Add to favorites – love, etc – and what do they do it to? Movies? recipes? Routes? Songs?
Narrating these stories is made up of four elements:
For e.g. ‘Zainab finished coding her first assignment at Hackbright’
• The Actor: This is the person who published the story (Zainab)
• The App: This is the app that publishes the story on the actor’s behalf. Every story is generated by an app and every story includes the app used to create it (Hackbright)
• The Action: This is the activity the actor performs (coding)
• The Object: This is the object the actor interacts with, (First assignment)
Create your app by visiting https://developers.facebook.com/apps. Set it up and publish your actions. You are now ready to enable users to share their stories through your app. Detailed information on each step can be viewed at https://developers.facebook.com/docs/opengraph/getting-started/.
Thanks to Zainab Ghhadiyali, a software engineer at Facebook, for coming to speak at Hackbright Academy for the first tech talk in our series!