Free Sample
+ Collection

Facebook Application Development with Graph API Cookbook

Cookbook
Shashwat Srivastava, Apeksha Singh

Over 90 recipes to create your own exciting Facebook applications at an incredibly fast pace with Facebook Graph API book and ebook
$26.99
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook

Want this title & more?

$21.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849690928
Paperback350 pages

About This Book

  • Dive headfirst into Facebook application development with the all new Facebook Graph API.
  • Packed with many demonstrations on how to use Facebook PHP and JS SDKs.
  • Step by step examples demonstrating common scenarios and problems encountered during Facebook Application Development.
  • Houses an exquisite collection of ready to use Facebook applications.

 

Who This Book Is For

This book is written for Facebook developers ranging from novice to expert. It uses PHP, HTML and jQuery, the most commonly used platforms, to build applications in Facebook.

Table of Contents

Chapter 1: Creating a New Facebook Application
Introduction
Downloading PHP-SDK and setting upyour environment
Registering a new Facebook application
Configuring a Facebook application
Getting authorization and a valid session for the user
Requesting specific permissions from the user
Logging out a user
Handling navigation in an iFrame Facebook application
Handling form submission in an iFrame Facebook application
Dynamically resizing an iFrame Facebook application
Determining whether a Facebook page has been liked by a user
Chapter 2: Be a part of Social Graph
Introduction
Retrieving a user's information
Liking a post
Commenting on a given post
Setting status message
Deleting a picture, post, or comment of a user
Retrieving the current user's friendlist
Creating a post on the wall of a user's friend
Posting a picture to a specific album of the user
Retrieving the names of the user's friends who have liked a particular status message
Creating an event
Paging through a user's friends
Searching through a user's feed
Tagging users in a picture
Adding a subscription for real time updates related to a user object
Creating a callback for handling real time updates
Deleting subscriptions
Chapter 3: Querying Facebook
Introduction
Returning information about a user
Getting the status messages of a user
Retrieving profile pictures of a user's friends
Getting the links posted by a user
Getting the Facebook pages followed by a user
Determining if two users are friends
Retrieving information of a group
Retrieving members of a group
Retrieving friends from a specific friend list
Getting all the messages in a thread
Checking the status of permissions for an application
Getting notifications, and their senders, for the current user
Retrieving video details associated with a user
Getting the five latest photos in which a user has been tagged
Retrieving the latest photos published by a user
Retrieving details of an event
Retrieving details of a user's friends by using the multiquery method
Chapter 4: Using FB Script
Introduction
Getting the current user status and performing session validation
Setting up extended permissions during login
Logging out a user
Resetting the size of iframe
Making a Graph API call
Executing an FQL query
Subscribing to an event change
Unsubscribing to an event change
Retrieving a profile picture using XFBML
Adding bookmarks using XFBML
Authentication and setting up extended permissions using XFBML
Chapter 5: Expressing Yourself
Introduction
Prompting the user to publish a story
Using Dialog to add someone as a friend
Using the OAuth Dialog to request permissions for your application
Prompting the user to send a request to friends
Processing requests sent to the user by friends
Chapter 6: Bringing Facebook to your Website
Introduction
Setting up the Like button on your web page
Adding a Like box
Setting up the Activity Feed plugin
Setting up the Facepile plugin on your web page
Integrating the Live Stream plugin using XFBML
Integrating the Comment box using XFBML
Integrating the Send button using XFBML
Login with Faces
Chapter 7: Connecting Websites to the Social Graph
Introduction
Integrating web pages into the social graph
Integrating audio and video data
Administering your page
Publishing stream updates to the users
Chapter 8: Fiddling with Virtual Currency
Introduction
Setting up the application for Facebook Credits
Setting up an application callback for Facebook Credits
Creating Facebook Credits frontend using JavaScript SDK
Getting the order details
Implementing custom offers
Refunding the order
Developing a "Send a Gift" application and integrating with Facebook Credits
Chapter 9: Creating Advertisements and Analyzing Metric Data
Introduction
Retrieving impressions of the Like Box plugin
Retrieving a page's stream views and wall posts using batch request
Getting the number of installations of an application using FQL
Getting statistics about visitors using FQL multiquery
Creating a new ad for your Facebook application
Chapter 10: Creating Instant Applications
Introduction
Creating a "Your Good Luck Charm of the Day" Facebook application
Designing a "My Fast Friends" Facebook application
Setting up a photo collage
Building a birthday calendar
Developing an application to classify friends according to the cities they live in
Chapter 11: Using Facebook Open Graph Beta
Introduction
Setting up your application for using Facebook Open Graph Beta
Defining actions, objects, and aggregations for your application
Customizing the Facebook Auth Dialog box
Requesting permission for publishing to the user's timeline
Defining your web page as a Facebook graph object
Publishing actions of a user to Facebook

What You Will Learn

  • Install Facebook PHP SDK and register your Facebook application
  • Obtain access token and perform session validation for current Facebook user
  • Work with the newly launched Facebook Graph API
  • Get an insight into the core of Facebook application development such as creating a post on wall, publishing pictures, tagging users, etc
  • Connect to Facebook Social Graph by using Facebook PHP and JavaScript SDKs
  • Leverage Facebook Query Language in order to obtain complex Facebook user data
  • Use Facebook Dialogs to enhance user experience
  • Power your websites with Facebook Social Plugins
  • Define your website content to Facebook Graph using Facebook Open Graph Protocol
  • Handle transactions through Facebook Credits
  • Use XFBML tags to enrich your application
  • Extract Facebook application analytics data
  • Create your own applications, from tip to toe, with ready to use code

 

In Detail

With a user base of nearly 800 million people, Facebook is the number one social networking platform. Applications can be created to interact with this huge user base in various ways both inside and outside Facebook. These applications, if developed effectively and efficiently, offer a free medium for promotion and publicity of a product or an organization.

Facebook Application Development with Graph API Cookbook covers both the concepts and implementations necessary to develop Facebook applications and provides ready to use code for common scenarios faced by a developer while creating these applications. It incorporates the newly launched Facebook Graph API and also presents the reader with some intuitive ready to use applications.

This book guides the reader step by step, from start to finish, through various stages of Facebook application development. It begins by exploring the Facebook application registration and discussing the verification and authentication technique. It then takes you through the various ways in which you can use Facebook Graph API for interacting with users such as posting on a user’s wall, tagging a user in a picture, etc. Accessing complex Facebook user data by formulating a series of queries, doing client side scripting and incorporating Facebook Dialog interface are some other features that have been incorporated in this book. Integration of various Facebook Social Plugins such as the like box in your web page has also been discussed. Further you will get to know the concept of virtual currency and how to programmatically derive Facebook analytics data. As the book progresses, you will learn to use and integrate many more advanced features in Facebook application development. The book contains ready to use code that can be deployed instantly. Towards the end, the book houses a variety of ready to use Facebook applications so as to help readers derive their own applications from them.

Authors

Read More