| Package | com.facebook.graph |
| Class | public class FacebookMobile |
| Inheritance | FacebookMobile AbstractFacebook Object |
| Property | Defined By | ||
|---|---|---|---|
| locale : String [static] [write-only] | FacebookMobile | ||
| manageSession : Boolean [static]
Setting to true (default), this class will manage
the session and access token internally. | FacebookMobile | ||
| Property | Defined By | ||
|---|---|---|---|
| applicationId : String | FacebookMobile | ||
| _canInit : Boolean = false [static] | FacebookMobile | ||
| initCallback : Function | FacebookMobile | ||
| _instance : FacebookMobile [static] | FacebookMobile | ||
| loginCallback : Function | FacebookMobile | ||
| loginWindow : MobileLoginWindow | FacebookMobile | ||
| logoutCallback : Function | FacebookMobile | ||
| _manageSession : Boolean = true | FacebookMobile | ||
| stageRef : Stage | FacebookMobile | ||
| webView : StageWebView | FacebookMobile | ||
| Method | Defined By | ||
|---|---|---|---|
Creates a new FacebookMobile instance
| FacebookMobile | ||
api(method:String, callback:Function, params:* = null, requestMethod:String = GET):void [static]
Makes a new request on the Facebook Graph API. | FacebookMobile | ||
batchRequest(batch:Batch, callback:Function = null):void [static]
Executes a batch api operation on facebook. | FacebookMobile | ||
callRestAPI(methodName:String, callback:Function = null, values:* = null, requestMethod:String = GET):void [static]
Used to make old style RESTful API calls on Facebook. | FacebookMobile | ||
deleteObject(method:String, callback:Function):void [static]
Deletes an object from Facebook. | FacebookMobile | ||
[static]
Executes an FQL multiquery on api.facebook.com. | FacebookMobile | ||
fqlQuery(query:String, callback:Function = null, values:Object = null):void [static]
Executes an FQL query on api.facebook.com. | FacebookMobile | ||
getImageUrl(id:String, type:String = null):String [static]
Utility method to format a picture URL,
in order to load an image from Facebook. | FacebookMobile | ||
getRawResult(data:Object):Object [static]
Returns a reference to the entire raw object
Facebook returns (including paging, etc.). | FacebookMobile | ||
[static]
Synchronous call to return the current user's session. | FacebookMobile | ||
hasNext(data:Object):Boolean [static]
Asks if another page exists
after this result object. | FacebookMobile | ||
hasPrevious(data:Object):Boolean [static]
Asks if a page exists
before this result object. | FacebookMobile | ||
init(applicationId:String, callback:Function, accessToken:String = null):void [static]
Initializes this Facebook singleton with your application ID. | FacebookMobile | ||
login(callback:Function, stageRef:Stage, extendedPermissions:Array, webView:StageWebView = null, display:String = touch):void [static]
Opens a new login window so the current user can log in to Facebook. | FacebookMobile | ||
logout(callBack:Function = null, appOrigin:String = null):void [static]
Clears a user's local session. | FacebookMobile | ||
nextPage(data:Object, callback:Function):FacebookRequest [static]
Retrieves the next page that is associated with result object passed in. | FacebookMobile | ||
postData(method:String, callback:Function, params:* = null):void [static]
Shortcut method to post data to Facebook. | FacebookMobile | ||
previousPage(data:Object, callback:Function):FacebookRequest [static]
Retrieves the previous page that is associated with result object passed in. | FacebookMobile | ||
requestExtendedPermissions(callback:Function, webView:StageWebView, ... extendedPermissions):void [static]
Opens a new window that asks the current user for
extended permissions. | FacebookMobile | ||
uploadVideo(method:String, callback:Function = null, params:* = null):void [static]
Shortcut method to upload video to Facebook. | FacebookMobile | ||
| Method | Defined By | ||
|---|---|---|---|
init(applicationId:String, callback:Function, accessToken:String = null):void | FacebookMobile | ||
| Constant | Defined By | ||
|---|---|---|---|
| SO_NAME : String = com.facebook.graph.FacebookMobile [static] | FacebookMobile | ||
| _canInit | property |
protected static var _canInit:Boolean = false| _instance | property |
protected static var _instance:FacebookMobile| _manageSession | property |
protected var _manageSession:Boolean = true| applicationId | property |
protected var applicationId:String| initCallback | property |
protected var initCallback:Function| locale | property |
locale:String [write-only] public static function set locale(value:String):void| loginCallback | property |
protected var loginCallback:Function| loginWindow | property |
protected var loginWindow:MobileLoginWindow| logoutCallback | property |
protected var logoutCallback:Function| manageSession | property |
public static var manageSession:BooleanSetting 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.
| stageRef | property |
protected var stageRef:Stage| webView | property |
protected var webView:StageWebView| FacebookMobile | () | Constructor |
public function FacebookMobile()Creates a new FacebookMobile instance
| api | () | method |
public static function api(method:String, callback:Function, params:* = null, requestMethod:String = GET):voidMakes a new request on the Facebook Graph API.
Parameters
method: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:* (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:String (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
| batchRequest | () | method |
public static function batchRequest(batch:Batch, callback:Function = null):voidExecutes a batch api operation on facebook.
Parameters
batch:Batch — The batch to send to facebook.
| |
callback:Function (default = null) |
See also
| callRestAPI | () | method |
public static function callRestAPI(methodName:String, callback:Function = null, values:* = null, requestMethod:String = 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.
Parameters
methodName: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:* (default = null) — URLRequestMethod used to send data to Facebook.
| |
requestMethod:String (default = GET) |
See also
| deleteObject | () | method |
public static function deleteObject(method:String, callback:Function):voidDeletes an object from Facebook. The current user must have granted extended permission to delete the corresponding object, or an error will be returned.
Parameters
method: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):voidExecutes an FQL multiquery on api.facebook.com.
Parameters
queries: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.
Parameters
query: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.
Parameters
id: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):ObjectReturns a reference to the entire raw object Facebook returns (including paging, etc.).
Parameters
data:Object — The result object.
|
Object |
See also
| getSession | () | method |
public static function getSession():FacebookSessionSynchronous call to return the current user's session.
ReturnsFacebookSession |
| hasNext | () | method |
public static function hasNext(data:Object):BooleanAsks if another page exists after this result object.
Parameters
data:Object — The result object.
|
Boolean |
See also
| hasPrevious | () | method |
public static function hasPrevious(data:Object):BooleanAsks if a page exists before this result object.
Parameters
data:Object — The result object.
|
Boolean |
See also
| init | () | method |
protected function init(applicationId:String, callback:Function, accessToken:String = null):voidParameters
applicationId:String | |
callback:Function | |
accessToken:String (default = null) |
| init | () | method |
public static function init(applicationId:String, callback:Function, accessToken:String = null):voidInitializes this Facebook singleton with your application ID. You must call this method first.
Parameters
applicationId:String — The application ID you created at
http://www.facebook.com/developers/apps.php
| |
callback:Function — 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) — If you have a previously saved access_token, you can pass it in here.
|
| login | () | method |
public static function login(callback:Function, stageRef:Stage, extendedPermissions:Array, webView:StageWebView = null, display:String = touch):voidOpens a new login window so the current user can log in to Facebook.
Parameters
callback: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.
| |
stageRef:Stage — A reference to the stage
| |
extendedPermissions:Array — (Optional) Array of extended permissions
to ask the user for once they are logged in.
| |
webView:StageWebView (default = null) — (Optional) The instance of StageWebView to use for the login window
| |
display:String (default = touch) — (Optional) The display type for the OAuth dialog. "wap" for older mobile browsers,
"touch" for smartphones. The Default is "touch".
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):voidClears a user's local session. This method is synchronous, since its method does not log the user out of Facebook, only the current application.
Parameters
callBack: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):FacebookRequestRetrieves the next page that is associated with result object passed in.
Parameters
data: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.
|
FacebookRequest |
See also
| postData | () | method |
public static function postData(method:String, callback:Function, params:* = null):voidShortcut method to post data to Facebook. Alternatively, you can call FacebookMobile.request and use POST for requestMethod.
Parameters
method:String | |
callback:Function | |
params:* (default = null) |
See also
| previousPage | () | method |
public static function previousPage(data:Object, callback:Function):FacebookRequestRetrieves the previous page that is associated with result object passed in.
Parameters
data: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.
|
FacebookRequest |
See also
| requestExtendedPermissions | () | method |
public static function requestExtendedPermissions(callback:Function, webView:StageWebView, ... extendedPermissions):voidOpens a new window that asks the current user for extended permissions.
Parameters
callback:Function — The method to call after request for permissions.
| |
webView:StageWebView — The instance of StageWebView to use.
| |
... extendedPermissions — Array of extended permissions to ask the user for once they are logged in.
|
See also
| uploadVideo | () | method |
public static function uploadVideo(method:String, callback:Function = null, params:* = null):voidShortcut method to upload video to Facebook.
Parameters
method:String — The method to call on the Graph API.
For example, to upload a video, pass in /me/videos. To upload to an friend's wall, pass in /USER_ID/videos.
| |
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:* (default = null) — An object containing the title, description, fileName (including extension), and video (FileReference or ByteArray)
|
See also
| SO_NAME | Constant |
protected static const SO_NAME:String = com.facebook.graph.FacebookMobile