Download presentation
Presentation is loading. Please wait.
1
Facebook Applications Teppo Räisänen
2
Facebook Applications Facebook provides many Software Development Kits (SDK’s) – PHP SDK – iOS SDK – Android SDK – JavaScript SDK
3
Facebook Applications Because school server does not support the newest PHP SDK we will use JavaScript SDK – JavaScript SDK provides a rich set of functionality for accessing Facebook’s API – Allow us to render XFBML versions of Social plugins – Invite friends, post to wall etc.
4
Facebook Applications You load the SDK using the standard element and calling FB.init -function – You must specify a element named fb-root within the document as well.
5
Facebook Applications FB.init({ appId : 'YOUR APP ID', status : true, // check login status cookie : true, // enable cookies xfbml : true, // parse XFBML channelURL : 'http://WWW.DOMAIN.COM/channel.html', oauth : true // enable OAuth 2.0 });
6
Facebook Applications Channel.html must contain only one line: This helps with few known bugs
7
Facebook Applications The first step is figuring out how you identify who the current user is, and how to make API calls on their behalf – FB.login() -- login and/or request extended permissions FB.login() – FB.logout() -- logout (only if the user is connected with your application) FB.logout() – FB.getLoginStatus() -- get current login status from facebook.com FB.getLoginStatus() – FB.getSession() -- synchronous accessor for the current session FB.getSession() See https://developers.facebook.com/docs/reference/javascrip t/ for more info https://developers.facebook.com/docs/reference/javascrip t/
8
Facebook Applications API calls can be made with FB.api –function: FB.api('/me', function(response) { alert(response.name); }); Makes a popup window displaying user’s name See http://developers.facebook.com/docs/reference/jav ascript/FB.api/ for more info http://developers.facebook.com/docs/reference/jav ascript/FB.api/
9
Facebook Applications API calls can be made with FB.api –function: FB.api('/me', function(response) { alert(response.name); }); Makes a popup window displaying user’s name See http://developers.facebook.com/docs/reference/jav ascript/FB.api/ for more info http://developers.facebook.com/docs/reference/jav ascript/FB.api/
10
Facebook Applications See https://apps.facebook.com/fbamdemoapp/ https://apps.facebook.com/fbamdemoapp/ Source code http://www.students.oamk.fi/~teraisan/fbam/demoap p.zip
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.