Facebook Application Development For Dummies by Jesse Stay

Facebook Application Development For Dummies by Jesse Stay

Author:Jesse Stay
Language: eng
Format: epub
Publisher: For Dummies
Published: 2011-04-06T16:00:00+00:00


Logging users

Facebook provides a certain level of analytics for each application that you can access in your application settings. They provide such data as monthly active users and other information about how many people are using your Web site or application who are users of Facebook.

However, although Facebook provides an overview of how many people are using your site, it’s impossible to find out through Facebook exactly who has visited your site, possibly because Facebook wants users to give permission before they identify themselves to your application.

For this reason, I strongly suggest that you prompt your users to log in and give the permissions you need (in a Canvas app, this is just approving permissions — they don’t need to log in because they are already logged in), and then as they approve your Web site or application, you store their Facebook ID in your database. When you store their Facebook ID in your database, you have a listing of exactly who is using your application or Web site from Facebook, and you can do neat stuff with that data. I share some ideas for that next.

Creating Scripts to Access Offline Data

After you have permissions to access user data, you get to do cool things with that data. One of the most powerful permissions that you can get from a user is the offline_access permission. This permission allows your application almost indefinite access to that user’s data, even when he or she is not logged in to Facebook. The only way for the user to turn off your access is to go into his privacy settings and revoke access to your application.

Making offline calls is just like making calls when you’re interacting with the user online. You just pass in the oauth_token parameter to Graph API, and Facebook gives you the data you need.

Here are some useful things you can do with offline_access:

Find out information about your users: Some Web sites like to process stats about demographics, age, gender, interests, and more about their users. If you have a database full of Facebook IDs and access tokens, you can run a script on a regular basis that makes Graph API calls to get information about each of those users. You can then report that in useful ways.

Queue requests for later: It doesn’t always make sense to make a request to Facebook at the exact time that the user requests to do so. For example, perhaps the user wants to publish something to Facebook, but she’s on a cell phone and doesn’t have access at the time she wants to publish. You can queue up her request and use her permanent token to publish the request to her feed later.

As always, when in doubt, consult the Developer documentation on developers.facebook.com! Facebook data access constantly changes, and it’s good to stay up on what’s new.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.