Facebook Cookbook - Jay Goldman [140]
is_mobile
bool
False ( 0) means you can’t run on Facebook Mobile; true (1) means you can.
default_fbml
string
Default FBML that appears in the user’s Profile Box when she adds your app, before you’ve set something specific.
default_column
bool
False ( 0) means you want to appear in the narrow column (sidebar); true (1) means you want to appear in the wide column (body) of user Profiles.
message_url
string
URL that Facebook uses to display your message attachment content.
message_action
string
Label for message attachment action for your app, which can’t be more than 20 characters.
about_url
string
URL for your app’s About Page.
private_install
bool
False ( 0) means you use the News Feed and Mini-Feed; true (1) means they’re disabled for your app.
installable
bool
False ( 0) means users can’t install your app; true (1) means they can.
privacy_url
string
URL for your app’s privacy terms.
help_url
string
URL for your app’s help page.
see_all_url
string
Appears to be an empty string.
tos_url
string
URL for your app’s Terms of Service.
dev_mode
bool
False ( 0) means developer mode is disabled; true (1) means it’s enabled, which blocks anyone who isn’t on the developer list from installing the app.
preload_fql
string
A preloaded FQL query.
default_action_fbml
string
Default FBML that appears in the user’s Profile actions when he adds your application, before you’ve set something specific.
canvas_name
string
The Canvas name of your app (read-only).
icon_url
string
URL for your app’s icon (read-only).
logo_url
string
A URL for your app’s logo, as shown in the product directory and search listings ( read-only).
Getting an App’s 4-1-1
Problem
Is there any way for me to retrieve the general public information about an app?
Solution
Use the Application.getPublicInfo() method, and pass in any one of the following properties for the target app:
application_id
api_key
application_canvas_name
Let’s say, for example, that you want to retrieve some information about the Zerofootprint Calculator. All three of the following will return the same array:
$appId = $facebook->api_client->application_getPublicInfo('8653633892');
$appAPI = $facebook->api_client->application_getPublicInfo
('d41570392c4b0d08a794f4a66b91a2a9');
$appCanvas = $facebook->api_client->admin_getPublicInfo('zfcalculator');
Discussion
The returned array includes the properties in Table 9-6.
Table 9-6. Properties returned by Application.getPublicInfo()
Property
Zerofootprint Calculator example
app_id
8653633892
api_key
d41570392c4b0d08a794f4a66b91a2a9
canvas_name
zfcalculator
display_name
Zerofootprint Calculator
icon_url
http://photos-892.ll.facebook.com/photos-ll-sctm/v43/8/8653633892/app_2_8653633892_7652.gif
logo_url
http://photos-892.ll.facebook.com/photos-ll-sctm/v43/8/8653633892/app_1_8653633892_3724.gif
developers
company_name
Zerofootprint Inc.
description
The Zerofootprint Calculator helps you measure your footprint on the environment. It takes just one minute to use and calculates how many tonnes of carbon you produce through driving, travel, diet, and home.
daily_active_users
300
daily_active_percentage
1
The developers field is empty in this case because the application is set as having a company name instead of individual developers (you can change this setting for your app by editing the About Page).
NOTE
This method is currently marked as beta in the Developers Wiki and is, in fact, so beta that it isn’t included in the currently released version of the Facebook PHP Client Library, but it will be soon.
Treat it with a little caution and make sure to report any bugs you might find into the Facebook Bug Tracker at http://bugs.developers.facebook.com.
Batching Calls
Problem
I have a bunch of calls I need to make using the API, and I’d really like to batch them to get better performance.
Solution
Facebook has recently released a Batch API that does exactly that. The