Your SlideShare is downloading. ×
Graph api
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Graph api

1,823

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,823
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
20
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Graph API
  • 2. SDKs & Tools
  • 3. Introductionhttps://developers.facebook.com/docs/sdks/ SDKs lets you access Graph API and other  JavaScript SDK (Graph API, dialogs)  PHP SDK (Graph API, Login)  iOS SDK (SSO, Graph API, dialogs)  Android SDK (SSO, Graph API, dialogs)  other (ex: c#) Tools  guides and tutorials  debuggers (ex: Graph API Explorer)
  • 4. JavaScript SDK Access Facebook server API calls from the client  Graph API  REST API  Dialogs Render XFBML social plugins Supports OAuth 2.0 App ID is needed to initialize the SDK
  • 5. Initialization<div id="fb-root"></div><script src="//connect.facebook.net/en_US/all.js"></script><script> FB.init({ appId : 178747652203562, status : true, cookie : true, xfbml : true, oauth : true });</script>
  • 6. Platform dialogs - FB.ui() Integrate Facebook UI flow into the application Feed Dialog Add a friend Authorize the application Buy credits Send application request Share a link
  • 7. Feed dialogFB.ui( { method: feed, name: Developer Community, link: https://www.facebook.com/event.php?eid=206539312741159, picture: http://blog.mist.sk/wp-content/uploads/2011/10/FacebookDevSK-thumb.jpg, caption: Facebook Developer Community, description: The first Facebook developer community meeting inBratislava }, function(response) { if (response && response.post_id) { alert(Post was published.); } else { alert(Post was not published.); } });
  • 8. Feed dialogFB.ui( { method: feed, name: Developer Community, link: https://www.facebook.com/event.php?eid=206539312741159, picture: http://blog.mist.sk/wp-content/uploads/2011/10/FacebookDevSK-thumb.jpg, caption: Facebook Developer Community, description: The first Facebook developer community meeting inBratislava }, function(response) { if (response && response.post_id) { alert(Post was published.); } else { alert(Post was not published.); } });
  • 9. Feed dialogFB.ui( { method: feed, name: Developer Community, link: https://www.facebook.com/event.php?eid=206539312741159, picture: http://blog.mist.sk/wp-content/uploads/2011/10/FacebookDevSK-thumb.jpg, caption: Facebook Developer Community, description: The first Facebook developer community meeting inBratislava }, function(response) { if (response && response.post_id) { alert(Post was published.); } else { alert(Post was not published.); } });
  • 10. Application requestFB.ui( { method: apprequests, message: Check the Bratislava Facebook Community meeting demo app }, function(response) { // handle callback console.log(response); });
  • 11. Application requestFB.ui( { method: apprequests, message: Check the Bratislava Facebook Community meeting demo app }, function(response) { // handle callback console.log(response); });
  • 12. Application requestFB.ui( { method: apprequests, message: Check the Bratislava Facebook Community meeting demo app }, function(response) { // handle callback console.log(response); });
  • 13. User Authentication Register to the website using Facebook or get the permissions for the app FB.login() FB.logout()  FB.getLoginStatus()  FB.getAuthResponse() Advantages    sharing logged in user state  registration flow on the website isnt needed  get access to the users social graph
  • 14. Login userFB.login( function(response) { if (response.authResponse) { console.log(Welcome! Fetching your information.... ); FB.api(/me, function(response) { console.log(Good to see you, + response.name + .); }); } else { console.log(User cancelled login or did not fully authorize.); } }, {scope: email});
  • 15. Login userFB.login( function(response) { if (response.authResponse) { console.log(Welcome! Fetching your information.... ); FB.api(/me, function(response) { console.log(Good to see you, + response.name + .); }); } else { console.log(User cancelled login or did not fully authorize.); } }, {scope: email});
  • 16. Demohttps://apps.facebook.com/bratislava-developer/
  • 17. Milan STESKAL@milansteskal @facebookDevSkfacebook.com/groups/188066214578728/

×