Package | com.distriqt.extension.facebookapi |
Class | public final class FacebookAPI |
Inheritance | FacebookAPI ![]() |
This class represents the FacebookAPI extension.
Property | Defined By | ||
---|---|---|---|
accountKit : AccountKit [read-only]
Access to the Account Kit functionality. | FacebookAPI | ||
appEvents : AppEvents [read-only]
Access to the Analytics functionality. | FacebookAPI | ||
appInvite : AppInvite [read-only]
Access to the AppInvite functionality to
create App Invite Dialogs. | FacebookAPI | ||
appLinks : AppLinks [read-only]
Access to the AppLinks functionality to
listen for and retrieve App Links. | FacebookAPI | ||
gameRequest : GameRequest [read-only]
Access to the AppInvite functionality to
create App Invite Dialogs. | FacebookAPI | ||
graphAPI : GraphAPI [read-only]
Access to the Graph API functionality. | FacebookAPI | ||
implementation : String [read-only]
The implementation currently in use. | FacebookAPI | ||
isSupported : Boolean [static] [read-only]
Whether the current device supports the extensions functionality
| FacebookAPI | ||
messageDialog : MessageDialog [read-only]
Access to the MessageDialog functionality to enable
people to post to Facebook Messenger from your application. | FacebookAPI | ||
nativeVersion : String [read-only]
The native version string of the native extension. | FacebookAPI | ||
service : FacebookAPI [static] [read-only]
The singleton instance of the FacebookAPI class. | FacebookAPI | ||
shareAPI : ShareAPI [read-only]
Access to the ShareAPI functionality to enable
people to post to Facebook from your application. | FacebookAPI | ||
shareDialog : ShareDialog [read-only]
Access to the ShareDialog functionality to enable
people to post to Facebook from your application. | FacebookAPI | ||
version : String [read-only]
The version of this extension. | FacebookAPI |
Method | Defined By | ||
---|---|---|---|
Constructor
You should not call this directly, but instead use the singleton access
| FacebookAPI | ||
closeSession():void
Closes the current Facebook session and logs the user out. | FacebookAPI | ||
createSession(permissions:Array, readOnly:Boolean = false, loginBehaviour:String):Boolean
Creates and authorises a new Facebook session for your user. | FacebookAPI | ||
dispose():void
Disposes the extension and releases any allocated resources. | FacebookAPI | ||
Retrieves the current session access token, if available
| FacebookAPI | ||
getCurrentUserID():String
Retrieves the current user's ID if available
| FacebookAPI | ||
getSDKVersion():String
Returns the current version of the FacebookSDK used by the extension. | FacebookAPI | ||
init(key:String):void Deprecated: You no longer need to use an application key [static]
Initialises the extension class for use with the provided key. | FacebookAPI | ||
initialiseApp(facebookAppId:String, urlSchemeSuffix:String):Boolean
Initialise the Facebook application by providing your Facebook
App ID. | FacebookAPI | ||
isFacebookAppInstalled():Boolean
Detects whether the device has the native Facebook app installed
| FacebookAPI | ||
isSessionOpen():Boolean
Checks if a session is currently open. | FacebookAPI | ||
requestPermissions(permissions:Array, readOnly:Boolean = false, loginBehaviour:String):Boolean
Requests new Facebook permissions for the application. | FacebookAPI | ||
userHasIntegratedFacebookAccount():Boolean
Detects whether the device has an integrated Facebook account set up in their iOS settings. | FacebookAPI |
Constant | Defined By | ||
---|---|---|---|
EXT_CONTEXT_ID : String = com.distriqt.FacebookAPI [static] | FacebookAPI | ||
VERSION : String = 7.1.212 [static] | FacebookAPI |
accountKit | property |
accountKit:AccountKit
[read-only]
Access to the Account Kit functionality.
public function get accountKit():AccountKit
appEvents | property |
appEvents:AppEvents
[read-only]
Access to the Analytics functionality.
public function get appEvents():AppEvents
appInvite | property |
appInvite:AppInvite
[read-only]
Access to the AppInvite
functionality to
create App Invite Dialogs.
public function get appInvite():AppInvite
appLinks | property |
appLinks:AppLinks
[read-only]
Access to the AppLinks
functionality to
listen for and retrieve App Links.
public function get appLinks():AppLinks
gameRequest | property |
gameRequest:GameRequest
[read-only]
Access to the AppInvite
functionality to
create App Invite Dialogs.
public function get gameRequest():GameRequest
graphAPI | property |
graphAPI:GraphAPI
[read-only]
Access to the Graph API functionality.
public function get graphAPI():GraphAPI
implementation | property |
implementation:String
[read-only]
The implementation currently in use. This should be one of the following depending on the platform in use and the functionality supported by this extension:
Android
iOS
default
unknown
public function get implementation():String
isSupported | property |
isSupported:Boolean
[read-only] Whether the current device supports the extensions functionality
public static function get isSupported():Boolean
messageDialog | property |
messageDialog:MessageDialog
[read-only]
Access to the MessageDialog
functionality to enable
people to post to Facebook Messenger from your application.
public function get messageDialog():MessageDialog
nativeVersion | property |
nativeVersion:String
[read-only]
The native version string of the native extension.
public function get nativeVersion():String
service | property |
service:FacebookAPI
[read-only] The singleton instance of the FacebookAPI class.
public static function get service():FacebookAPI
Error — If there was a problem creating or accessing the extension, or if the developer key is invalid
|
shareAPI | property |
shareAPI:ShareAPI
[read-only]
Access to the ShareAPI
functionality to enable
people to post to Facebook from your application.
public function get shareAPI():ShareAPI
shareDialog | property |
shareDialog:ShareDialog
[read-only]
Access to the ShareDialog
functionality to enable
people to post to Facebook from your application.
public function get shareDialog():ShareDialog
version | property |
version:String
[read-only]
The version of this extension.
This should be of the format, MAJOR.MINOR.BUILD
public function get version():String
FacebookAPI | () | Constructor |
public function FacebookAPI()
Constructor You should not call this directly, but instead use the singleton access
closeSession | () | method |
public function closeSession():void
Closes the current Facebook session and logs the user out.
createSession | () | method |
public function createSession(permissions:Array, readOnly:Boolean = false, loginBehaviour:String):Boolean
Creates and authorises a new Facebook session for your user. If the user already has an access token, this may not change the view, but simply return.
If the user is not logged in and has no access token, the login flow will begin.
If the device has the Facebook application installed, the flow will switch to the Facebook app for the login and permissions dialog. If not, this will fall back to using a browser-based web login page.
It's best to request basic access such as "basic_info" when creating a session, and then request publish permissions later when required by your application. This method of permission request is recommended by Facebook.
Parameters
permissions:Array — Array of Facebook permissions to request for the session
| |
readOnly:Boolean (default = false ) — Whether your app only requires read permissions. Set to true if you are not requesting any publish permissions. (defaults to false )
| |
loginBehaviour:String (default = NaN ) — Value from the LoginBehaviour constants
|
Boolean — true if the process was started successfully and false if there was an error
|
dispose | () | method |
public function dispose():void
Disposes the extension and releases any allocated resources. Once this function
has been called, a call to init
is neccesary again before any of the
extensions functionality will work.
getAccessToken | () | method |
public function getAccessToken():AccessToken
Retrieves the current session access token, if available
ReturnsAccessToken — The access token
|
getCurrentUserID | () | method |
public function getCurrentUserID():String
Retrieves the current user's ID if available
ReturnsString — The current logged in user's ID
|
getSDKVersion | () | method |
public function getSDKVersion():String
Returns the current version of the FacebookSDK used by the extension.
ReturnsString — String the Facebook SDK version
|
init | () | method |
public static function init(key:String):void
Initialises the extension class for use with the provided key.
Parameters
key:String |
Error — If there was a problem creating or accessing the extension, or if the key is invalid
|
initialiseApp | () | method |
public function initialiseApp(facebookAppId:String, urlSchemeSuffix:String):Boolean
Initialise the Facebook application by providing your Facebook App ID.
Parameters
facebookAppId:String — A Facebook application id
| |
urlSchemeSuffix:String — (Optional)
The URL Scheme Suffix to be used in
scenarios where multiple iOS applications
use one Facebook App ID.
Must contain only lowercase letters.
|
Boolean —
|
isFacebookAppInstalled | () | method |
public function isFacebookAppInstalled():Boolean
Detects whether the device has the native Facebook app installed
ReturnsBoolean — Boolean true or false
|
isSessionOpen | () | method |
public function isSessionOpen():Boolean
Checks if a session is currently open.
ReturnsBoolean — Boolean True or false if a session is opened
|
requestPermissions | () | method |
public function requestPermissions(permissions:Array, readOnly:Boolean = false, loginBehaviour:String):Boolean
Requests new Facebook permissions for the application.
Parameters
permissions:Array — Array of facebook permissions to request
| |
readOnly:Boolean (default = false ) — Whether the permissions are "read" only.
Set to true if you are requesting read permissions.
Set to false if you are requesting publish permissions.
(defaults to false )
| |
loginBehaviour:String (default = NaN ) — Value from the LoginBehaviour constants
|
Boolean — true if the process was started successfully and false if there was an error
|
userHasIntegratedFacebookAccount | () | method |
public function userHasIntegratedFacebookAccount():Boolean
Detects whether the device has an integrated Facebook account set up in their iOS settings.
This is only relevant on iOS and will always return false on Android devices.
ReturnsBoolean — true if the device has a Facebook account set up in the settings
|
EXT_CONTEXT_ID | Constant |
public static const EXT_CONTEXT_ID:String = com.distriqt.FacebookAPI
VERSION | Constant |
public static const VERSION:String = 7.1.212