Package | com.facebook.graph |
Class | public class FacebookDesktop |
Inheritance | FacebookDesktop com.facebook.graph.core.AbstractFacebook |
Property | Defined by | ||
---|---|---|---|
locale : String [static][write-only]
| FacebookDesktop | ||
manageSession : Boolean [static][write-only]
Setting to true (default), this class will manage
the session and access token internally.
| FacebookDesktop |
Method | Defined by | ||
---|---|---|---|
Creates a new FacebookDesktop instance
| FacebookDesktop | ||
api(method:String, callback:Function, params:String = null, requestMethod:* = GET):void
[static]
Makes a new request on the Facebook Graph API.
| FacebookDesktop | ||
callRestAPI(methodName:String, callback:Function = null, values:String = null, requestMethod:* = GET):void
[static]
Used to make old style RESTful API calls on Facebook.
| FacebookDesktop | ||
deleteObject(method:String, callback:Function):void
[static]
Deletes an object from Facebook.
| FacebookDesktop | ||
fqlMultiQuery(queries:FQLMultiQuery, callback:Function = null, parser:IResultParser = null):void
[static]
Executes an FQL multiquery on api.facebook.com.
| FacebookDesktop | ||
fqlQuery(query:String, callback:Function = null, values:Object = null):void
[static]
Executes an FQL query on api.facebook.com.
| FacebookDesktop | ||
getImageUrl(id:String, type:String = null):String
[static]
Utility method to format a picture URL,
in order to load an image from Facebook.
| FacebookDesktop | ||
getRawResult(data:Object):Object
[static]
Returns a reference to the entire raw object
Facebook returns (including paging, etc.).
| FacebookDesktop | ||
getSession():FacebookSession
[static]
Synchronous call to return the current user's session.
| FacebookDesktop | ||
hasNext(data:Object):Boolean
[static]
Asks if another page exists
after this result object.
| FacebookDesktop | ||
hasPrevious(data:Object):Boolean
[static]
Asks if a page exists
before this result object.
| FacebookDesktop | ||
init(applicationId:String, callback:Function = null, accessToken:String = null):void
[static]
Initializes this Facebook singleton with your application ID.
| FacebookDesktop | ||
login(callback:Function, ... extendedPermissions):void
[static]
Opens a new login window so the current user can log in to Facebook.
| FacebookDesktop | ||
logout(callback:Function = null, appOrigin:String = null):void
[static]
Clears a user's local session.
| FacebookDesktop | ||
nextPage(data:Object, callback:Function):void
[static]
Retrieves the next page that is associated with result object passed in.
| FacebookDesktop | ||
postData(method:String, callback:Function, params:* = null):void
[static]
Shortcut method to post data to Facebook.
| FacebookDesktop | ||
previousPage(data:Object, callback:Function):void
[static]
Retrieves the previous page that is associated with result object passed in.
| FacebookDesktop | ||
requestExtendedPermissions(callback:Function, ... extendedPermissions):void
[static]
Opens a new window that asks the current user for
extended permissions.
| FacebookDesktop |
Method | Defined by | ||
---|---|---|---|
handleLogout(result:Object, fail:Object):void
| FacebookDesktop |
locale | property |
locale:String
[write-only]Implementation
public function set locale(value:String):void
manageSession | property |
manageSession:Boolean
[write-only]Setting to true (default), this class will manage the session and access token internally. Setting to false, no session management will occur and the end developer must save the session manually.
Implementation public function set manageSession(value:Boolean):void
FacebookDesktop | () | constructor |
public function FacebookDesktop()
Creates a new FacebookDesktop instance
api | () | method |
public static function api(method:String, callback:Function, params:String = null, requestMethod:* = GET):void
Makes 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 in /me/friends
|
|
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.
|
|
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
callRestAPI | () | method |
public static function callRestAPI(methodName:String, callback:Function = null, values:String = null, requestMethod:* = GET):void
Used 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 (default = null ) — Any values to pass to this request.
|
|
values:String (default = null ) — URLRequestMethod used to send data to Facebook.
|
|
requestMethod:* (default = GET )
|
See also
deleteObject | () | method |
public static function deleteObject(method:String, callback:Function):void
Deletes 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 |
See also
fqlMultiQuery | () | method |
public static function fqlMultiQuery(queries:FQLMultiQuery, callback:Function = null, parser:IResultParser = null):void
Executes 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):void
Executes 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):String
Utility 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
getRawResult | () | method |
public static function getRawResult(data:Object):Object
Returns 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():FacebookSession
Synchronous call to return the current user's session.
ReturnsFacebookSession |
handleLogout | () | method |
protected function handleLogout(result:Object, fail:Object):void
Parameters
result:Object |
|
fail:Object |
hasNext | () | method |
public static function hasNext(data:Object):Boolean
Asks if another page exists after this result object.
Parametersdata:Object — The result object.
|
Boolean |
See also
hasPrevious | () | method |
public static function hasPrevious(data:Object):Boolean
Asks 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, accessToken:String = null):void
Initializes 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.
|
|
accessToken:String (default = null ) — (Optional) If you have a previously saved access_token, you can pass it in here.
|
login | () | method |
public static function login(callback:Function, ... extendedPermissions):void
Opens a new login window so the current user can log in to Facebook.
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.
|
|
... extendedPermissions — (Optional) Array of extended permissions
to ask the user for once they are logged in.
For the most current list of extended permissions,
visit http://developers.facebook.com/docs/authentication/permissions
|
See also
logout | () | method |
public static function logout(callback:Function = null, appOrigin:String = null):void
Clears a user's local session. This method is synchronous, since its method does not log the user out of Facebook, only the current application.
Parameterscallback:Function (default = null ) — (Optional) Method to call when logout is done.
|
|
appOrigin:String (default = null ) — (Optional) The site url specified for your app. Required for clearing html window cookie.
|
nextPage | () | method |
public static function nextPage(data:Object, callback:Function):void
Retrieves 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, params:* = null):void
Shortcut method to post data to Facebook. Alternatively, you can call FacebookDesktop.request and use POST for requestMethod.
Parametersmethod:String |
|
callback:Function |
|
params:* (default = null )
|
See also
previousPage | () | method |
public static function previousPage(data:Object, callback:Function):void
Retrieves 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
requestExtendedPermissions | () | method |
public static function requestExtendedPermissions(callback:Function, ... extendedPermissions):void
Opens a new window that asks the current user for extended permissions.
Parameterscallback:Function — The method to call after request for permissions.
|
|
... extendedPermissions — Array of extended permissions to ask the user for once they are logged in.
|
See also