| Package | com.facebook.graph |
| Class | public class Facebook |
| Inheritance | Facebook AbstractFacebook |
| Property | Defined by | ||
|---|---|---|---|
| locale : String [static][write-only]
| |||
| Method | Defined by | ||
|---|---|---|---|
|
Facebook()
Creates an instance of Facebook.
| |||
|
addJSEventListener(event:String, listener:Function):void
[static]
Utility method to add listeners to the underlying Facebook library.
| |||
|
api(method:String, callback:Function = null, params:String = null, requestMethod:* = GET):void
[static]
Makes a new request on the Facebook Graph API.
| |||
|
callJS(methodName:String, params:Object):void
[static]
Calls an arbitrary Javascript method on the underlying HTML page.
| |||
|
callRestAPI(methodName:String, callback:Function, values:String = null, requestMethod:* = GET):void
[static]
Used to make old style RESTful API calls on Facebook.
| |||
|
deleteObject(method:String, callback:Function = null):void
[static]
Deletes an object from Facebook.
| |||
|
[static]
Executes an FQL multiquery on api.facebook.com.
| |||
|
fqlQuery(query:String, callback:Function = null, values:Object = null):void
[static]
Executes an FQL query on api.facebook.com.
| |||
|
getImageUrl(id:String, type:String = null):String
[static]
Utility method to format a picture URL,
in order to load an image from Facebook.
| |||
|
getLoginStatus():void
[static]
Asynchronous method to get the user's current session from Facebook.
| |||
|
getRawResult(data:Object):Object
[static]
Returns a reference to the entire raw object
Facebook returns (including paging, etc.).
| |||
|
[static]
Synchronous method to retrieve the current user's session.
| |||
|
hasJSEventListener(event:String, listener:Function):Boolean
[static]
Checks to see if a specified event listener exists.
| |||
|
hasNext(data:Object):Boolean
[static]
Asks if another page exists
after this result object.
| |||
|
hasPrevious(data:Object):Boolean
[static]
Asks if a page exists
before this result object.
| |||
|
init(applicationId:String, callback:Function = null, options:Object = null, accessToken:String = null):void
[static]
Initializes this Facebook singleton with your Application ID.
| |||
|
login(callback:Function, options:Object = null):void
[static]
Shows the Facebook login window to the end user.
| |||
|
logout(callback:Function):void
[static]
Logs the user out of their current session.
| |||
|
mobileLogin(redirectUri:String, display:String = "touch", extendedPermissions:Array = null):void
[static]
Re-directs the user to a mobile-friendly login form.
| |||
|
mobileLogout(redirectUri:String):void
[static]
Logs the user out after being logged in with mobileLogin().
| |||
|
nextPage(data:Object, callback:Function):void
[static]
Retrieves the next page that is associated with result object passed in.
| |||
|
postData(method:String, callback:Function = null, params:Object = null):void
[static]
Shortcut method to post data to Facebook.
| |||
|
previousPage(data:Object, callback:Function):void
[static]
Retrieves the previous page that is associated with result object passed in.
| |||
|
removeJSEventListener(event:String, listener:Function):void
[static]
Removes a Javascript event listener,
added by Facebook.addJSEventListener();
| |||
|
setCanvasAutoResize(autoSize:Boolean = true, interval:uint = 100):void
[static]
| |||
|
setCanvasSize(width:Number, height:Number):void
[static]
| |||
|
ui(method:String, data:Object, callback:Function = null, display:String = null):void
[static]
Shows a Facebook sharing dialog.
| |||
| locale | property |
locale:String [write-only]Implementation
public function set locale(value:String):void
| () | constructor |
public function Facebook()Creates an instance of Facebook.
| addJSEventListener | () | method |
public static function addJSEventListener(event:String, listener:Function):voidUtility method to add listeners to the underlying Facebook library.
Parametersevent:String — Name of the Javascript event to listen for.
|
|
listener:Function — Name of function to call when event is fired.
This method will need to accept an optional result:Object,
that will be the decoded JSON result, if one exists.
|
See also
| api | () | method |
public static function api(method:String, callback:Function = null, params:String = null, requestMethod:* = GET):voidMakes a new request on the Facebook Graph API.
Parametersmethod:String — The method to call on the Graph API.
For example, to load the user's current friends, pass: /me/friends
|
|
callback:Function (default = null) — Method that will be called when this request is complete
The handler must have the signature of callback(result:Object, fail:Object);
On success, result will be the object data returned from Facebook.
On fail, result will be null and fail will contain information about the error.
|
|
params:String (default = null) — Any parameters to pass to Facebook.
For example, you can pass {file:myPhoto, message:'Some message'};
this will upload a photo to Facebook.
|
|
requestMethod:* (default = GET) — The URLRequestMethod used to send values to Facebook.
The graph API follows correct Request method conventions.
GET will return data from Facebook.
POST will send data to Facebook.
DELETE will delete an object from Facebook.
|
See also
| callJS | () | method |
public static function callJS(methodName:String, params:Object):voidCalls an arbitrary Javascript method on the underlying HTML page.
ParametersmethodName:String |
|
params:Object |
| callRestAPI | () | method |
public static function callRestAPI(methodName:String, callback:Function, values:String = null, requestMethod:* = GET):voidUsed to make old style RESTful API calls on Facebook. Normally, you would use the Graph API to request data. This method is here in case you need to use an old method, such as FQL.
ParametersmethodName:String — Name of the method to call on api.facebook.com
(ex, fql.query).
|
|
callback:Function — Any values to pass to this request.
|
|
values:String (default = null) — URLRequestMethod used to send data to Facebook.
|
|
requestMethod:* (default = GET) |
| deleteObject | () | method |
public static function deleteObject(method:String, callback:Function = null):voidDeletes an object from Facebook. The current user must have granted extended permission to delete the corresponding object, or an error will be returned.
Parametersmethod:String — The ID and connection of the object to delete.
For example, /POST_ID/like to remove a like from a message.
|
|
callback:Function (default = null) |
See also
| fqlMultiQuery | () | method |
public static function fqlMultiQuery(queries:FQLMultiQuery, callback:Function = null, parser:IResultParser = null):voidExecutes an FQL multiquery on api.facebook.com.
Parametersqueries:FQLMultiQuery — FQLMultiQuery The FQL queries to execute.
|
|
callback:Function (default = null) — IResultParser The parser used to parse result into object of name/value pairs.
|
|
parser:IResultParser (default = null) |
See also
| fqlQuery | () | method |
public static function fqlQuery(query:String, callback:Function = null, values:Object = null):voidExecutes an FQL query on api.facebook.com.
Parametersquery:String — The FQL query string to execute.
|
|
callback:Function (default = null) — Replaces string values in the in the query.
ie. Replaces {digit} or {id} with the corresponding key-value in the values object
|
|
values:Object (default = null) |
See also
| getImageUrl | () | method |
public static function getImageUrl(id:String, type:String = null):StringUtility method to format a picture URL, in order to load an image from Facebook.
Parametersid:String — The ID you wish to load an image from.
|
|
type:String (default = null) — The size of image to display from Facebook
(square, small, or large).
|
String |
See also
| getLoginStatus | () | method |
public static function getLoginStatus():voidAsynchronous method to get the user's current session from Facebook. This method calls out to the underlying Javascript SDK to check what the current user's login status is. You can listen for a javscript event by using Facebook.addJSEventListener('auth.sessionChange', callback)
See also
| getRawResult | () | method |
public static function getRawResult(data:Object):ObjectReturns a reference to the entire raw object Facebook returns (including paging, etc.).
Parametersdata:Object — The result object.
|
Object |
See also
| getSession | () | method |
public static function getSession():FacebookSessionSynchronous method to retrieve the current user's session.
ReturnsFacebookSession |
| hasJSEventListener | () | method |
public static function hasJSEventListener(event:String, listener:Function):BooleanChecks to see if a specified event listener exists.
Parametersevent:String |
|
listener:Function |
Boolean |
| hasNext | () | method |
public static function hasNext(data:Object):BooleanAsks if another page exists after this result object.
Parametersdata:Object — The result object.
|
Boolean |
See also
| hasPrevious | () | method |
public static function hasPrevious(data:Object):BooleanAsks if a page exists before this result object.
Parametersdata:Object — The result object.
|
Boolean |
See also
| init | () | method |
public static function init(applicationId:String, callback:Function = null, options:Object = null, accessToken:String = null):voidInitializes this Facebook singleton with your Application ID. You must call this method first.
ParametersapplicationId:String — The application ID you created at
http://www.facebook.com/developers/apps.php
|
|
callback:Function (default = null) — (Optional)
Method to call when initialization is complete.
The handler must have the signature of callback(success:Object, fail:Object);
Success will be a FacebookSession if successful, or null if not.
|
|
options:Object (default = null) — (Optional)
Object of options used to instantiate the underling Javascript SDK
|
|
accessToken:String (default = null) — (Optional)
A valid Facebook access token. If you have a previously saved access token, you can pass it in here.
|
See also
| login | () | method |
public static function login(callback:Function, options:Object = null):voidShows the Facebook login window to the end user.
Parameterscallback:Function — The method to call when login is successful.
The handler must have the signature of callback(success:Object, fail:Object);
Success will be a FacebookSession if successful, or null if not.
|
|
options:Object (default = null) — Values to modify the behavior of the login window.
http://developers.facebook.com/docs/reference/javascript/FB.login
|
| logout | () | method |
public static function logout(callback:Function):voidLogs the user out of their current session.
Parameterscallback:Function — Method to call when logout is complete.
|
| mobileLogin | () | method |
public static function mobileLogin(redirectUri:String, display:String = "touch", extendedPermissions:Array = null):voidRe-directs the user to a mobile-friendly login form.
ParametersredirectUri:String — After a successful login,
Facebook will redirect the user back to this URL,
where the underlying Javascript SDK will notify this swf
that a valid login has occurred.
|
|
display:String (default = "touch") — Type of login form to show to the user.
|
|
extendedPermissions:Array (default = null) — (Optional) Array of extended permissions
to ask the user for once they are logged in.
|
See also
| mobileLogout | () | method |
public static function mobileLogout(redirectUri:String):voidLogs the user out after being logged in with mobileLogin().
ParametersredirectUri:String — After logout, Facebook will redirect
the user back to this URL.
|
| nextPage | () | method |
public static function nextPage(data:Object, callback:Function):voidRetrieves the next page that is associated with result object passed in.
Parametersdata:Object — The result object.
|
|
callback:Function — Method that will be called when this request is complete
The handler must have the signature of callback(result:Object, fail:Object);
On success, result will be the object data returned from Facebook.
On fail, result will be null and fail will contain information about the error.
|
See also
| postData | () | method |
public static function postData(method:String, callback:Function = null, params:Object = null):voidShortcut method to post data to Facebook. Alternatively, you can call Facebook.request and use POST for requestMethod.
Parametersmethod:String |
|
callback:Function (default = null) |
|
params:Object (default = null) |
See also
| previousPage | () | method |
public static function previousPage(data:Object, callback:Function):voidRetrieves the previous page that is associated with result object passed in.
Parametersdata:Object — The result object.
|
|
callback:Function — Method that will be called when this request is complete
The handler must have the signature of callback(result:Object, fail:Object);
On success, result will be the object data returned from Facebook.
On fail, result will be null and fail will contain information about the error.
|
See also
| removeJSEventListener | () | method |
public static function removeJSEventListener(event:String, listener:Function):voidRemoves a Javascript event listener, added by Facebook.addJSEventListener();
Parametersevent:String |
|
listener:Function |
See also
| setCanvasAutoResize | () | method |
public static function setCanvasAutoResize(autoSize:Boolean = true, interval:uint = 100):voidParameters
autoSize:Boolean (default = true) |
|
interval:uint (default = 100) |
See also
| setCanvasSize | () | method |
public static function setCanvasSize(width:Number, height:Number):voidParameters
width:Number |
|
height:Number |
See also
| ui | () | method |
public static function ui(method:String, data:Object, callback:Function = null, display:String = null):voidShows a Facebook sharing dialog.
Parametersmethod:String — The related method for this dialog
(ex. stream.publish).
|
|
data:Object — Data to pass to the dialog, date will be JSON encoded.
|
|
callback:Function (default = null) — (Optional) Method to call when complete
|
|
display:String (default = null) — (Optional) The type of dialog to show (iframe or popup).
|
See also