Class fb

Library for building facebook apps. Importing facebook will automatically make all known FBML tags available as functional HTML tags, with : replaced with _. For example, the you can create a FB:FRIEND-SELECTOR tag by calling FB_FRIEND_SELECTOR(). See: http://wiki.developers.facebook.com/index.php/Category:FBML_tags
Defined in: facebook.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
fb()
The FaceBook object.
Field Summary
Field Attributes Field Name and Description
<static>  
fb.friends
List of the uids of the current user's friends.
<static>  
contains "http://apps.facebook.com/<the_canvasl_url>/"
<static>  
The current facebook sessionKey.
<static>  
fb.uid
The facebook uid of the current user of this app.
Method Summary
Method Attributes Method Name and Description
<static>  
Checks post parameters against fb_sig to verify that the reqest came from facebook servers and not a haxxor.
<static>  
fb.call(cmd, params)
Executes a remote facebook API call.
<static>  
fb.init()
Every facebook app should call fb.init() immediately after import("facebook").
<static>  
fb.redirect(url)
Tells facebook to redirect the user to a new URL.
<static>  
Ensures that the current user has added this app.
<static>  
fb.sendNotification(users, notificationFBML)
Convenience function for sending a notification to 1 or more users.
<static>  
fb.setProfileFBML(uid, markup)
Convenience function for setting a user's profile FBML.
Class Detail
fb()
The FaceBook object.
Field Detail
<static> fb.friends
List of the uids of the current user's friends. This will only be filled in if the session user has added the app and is logged in to it.

<static> fb.fullCanvasUrl
contains "http://apps.facebook.com/<the_canvasl_url>/"

<static> fb.sessionKey
The current facebook sessionKey. This will only be set if the session user has added the app and is logged in to it. Otherwise, it will be undefined.

<static> fb.uid
The facebook uid of the current user of this app.
Method Detail
<static> {boolean} fb.authenticateRequest()
Checks post parameters against fb_sig to verify that the reqest came from facebook servers and not a haxxor. Note: this method is called automatically by fb.init(), so you usually do not need to call it directly.
Returns:
{boolean} true if the request is from facebook and legit; false otherwise.

<static> {object} fb.call(cmd, params)
Executes a remote facebook API call. See the Facebok API Methods wiki page for a list of all methods.
fb.requireAdd();
print(fb.call("users.getInfo",
              { uids: [700577, 550505927],
                fields: ["birthday", "about_me"] }));
Parameters:
{string} cmd
The name of the command, e.g. "facebook.profile.setFBML".
{object} params
The set of parameters to pass to this call. Note: api_key, sesion_key, call_id, v, and format, and sig will be automatically set for you. However, you can override any of these if you like.
Returns:
{object} The call result, as a javascript object.

<static> fb.init()
Every facebook app should call fb.init() immediately after import("facebook"). It will first make sure the AppJet app is configured as a valid facebook app. Next, if the request path starts with "/callback/", it will authenticate that the request from facebook and then set up all the fb.* properties.

<static> fb.redirect(url)
Tells facebook to redirect the user to a new URL. For FBML facebook apps, use this instead of response.redirect(), so that it redirects the facebook user instead of the facebook server.
Parameters:
{string} url Optional
The new URL to direct the user to. If you do not set this parameter, the user will be redirected to the main canvas page.

<static> fb.requireAdd()
Ensures that the current user has added this app. If the current user of the app has already added it, this does nothing. Otherwise, it immediately redirects the user to the add page.

<static> fb.sendNotification(users, notificationFBML)
Convenience function for sending a notification to 1 or more users. See: Facebook's docs for facebook.notifications.send.
Parameters:
{array or string} users
Array of uids or single uid of those to receive this notification.
{string} notificationFBML
The FBML content of the notification.

<static> fb.setProfileFBML(uid, markup)
Convenience function for setting a user's profile FBML. See Facebook's docs for facebook.profile.setFBML.
fb.requireAdd();
fb.setProfileFBML(fb.uid,
    DIV(CENTER(
        "Here is another picture of me:",
        BR(),
        FB_PROFILE_PIC({uid: fb.uid}))));
Parameters:
{string} uid
The uid of the profile to set.
{string} markup
The text of the FBML to set.

©2011 by JGate on AppJet
Documentation generated by JsDoc Toolkit 2.1.0 on Thu Jan 06 2011 10:36:33 GMT+0100 (MEZ)