Unleash Your Potential - Namagunga Girls Coding Club
Developing Facebook Application
1. Developing Facebook
Application
Wasu Khaodee
Kanda Runapongsa Saikaew
Computer Engineering
Khon Kaen University
2. Facebook Application Types
1. Run on web-browser
1.1 A Website
1.2 Canvas Application
(Apps on Facebook.com)
2. Run on a platform
- Mobile Application
In this slide, we focus on developing Canvas Application
3. Focused Facebook APIs
1. Graph API
The Graph API is the core of Facebook Platform, enabling
you to read and write data to Facebook
“nested query” is not supported by Graph API and in many
cases, we need to get the data with multiple Graph API
requests
2. FQL (Facebook Query Language)
FQL is designed to condense Facebook queries and reduce
response size
Has similar syntax with SQL but there are somethings that
cannot be done in FQL such as
No Group by
4. What is Graph API?
At Facebook's core is the social graph; people and the connections
they have to everything they care about
The Graph API presents a simple, consistent view of the Facebook
social graph, uniformly representing objects in the graph (e.
g., people, photos, events, and pages) and the connections
between them (e.g., friend relationships, shared content, and photo
tags)
Every object in the social graph has a unique ID
You can access the properties of an object by requesting https:
//graph.facebook.com/ID
5. What is FQL?
Facebook Query Language, or FQL, enables you to use a SQL-style
interface to query the data exposed by the Graph API. It provides for
some advanced features not available in the Graph API, including
batching multiple queries into a single call
You can execute FQL queries by fetching https://api.facebook.
com/method/fql.query?query=QUERY. You can specify a response
format as either XML or JSON with the format query parameter.
Example
SELECT name FROM user WHERE uid = me()
6. Facebook Software
Development Kit (SDK)
Here we are using PHP and Java Script
- PHP SDK where source
here : https://github.com/facebook/php-sdk/
- Java Script where source
here : http://connect.facebook.net/en_US/all.js
7. Application Permissions
Applications Permissions
http://developers.facebook.
com/docs/authentication/permissions
Your App got only public data access without request
more permission.
Likes your app need to post some content
"publish_stream" need to be requested.
8. Creating Your Canvas App (1/4)
First goto : http://www.facebook.com/developers/
here
9. Creating Your Canvas App (2/4)
Your Apps Name here
And read the Terms
then create the app
11. Creating Your Canvas App (4/4)
For Apps URL is where user access to your app.
Like http://apps.facebook.com/fbpublishpage
And host URL is where your Code is located.
Here we choose Canvas type as IFrame according to
Developer Roadmap
12. Create App Instance
get the SDK here : facebook.php
or download here : https://github.com/facebook/php-
sdk/archives/master
13. Get Session and Login
//Get App Session
//Get User Info to check the
login status
//Get login URL (also
grants permissions)
//Just login if the user did not login