AccountKit
This class is no longer available in the most recent version of the SDK.

This seems to be the main class for initialization and login for AccountKit.

Extends:Object
Package:accountkit
Constructors
AccountKit()
public AccountKit()
Class Methods
getLoggingBehaviors()

The console logging behaviors, which can be configured for debugging.

public static LoggingBehaviorCollection getLoggingBehaviors()
Returns
A LoggingBehaviorCollection
isInitialized()

Indicates whether the AccountKit SDK has been initialized.

public static boolean isInitialized()
Returns
True if initialized, false if not
initialize(Context)

This function initializes the AccountKit SDK, the behavior of AccountKit SDK functions are undetermined if this function is not called. It should be called as early as possible.

public static synchronized void initialize(Context applicationContext)
ParameterDescription
applicationContextThe application context
initialize(Context, InitializeCallback)

This function initializes the AccountKit SDK, the behavior of AccountKit SDK functions are undetermined if this function is not called. It should be called as early as possible.

public static void initialize(Context applicationContext, InitializeCallback callback)
ParameterDescription
applicationContextThe application context
callbackA callback called when initialize finishes. This will be called even if the sdk is already initialized.
logInWithEmail(String, String, String)

Starts the email login through sending a confirmation email to the given email

To ensure thread safety please call this from the UI thread

If an account is already logged in. Calling this method will cause that account to be logged out.

public static EmailLoginModel logInWithEmail(String email, String responseType, String initialAuthState)
ParameterDescription
emailThe email to use for login
responseTypeThe response type expected
initialAuthStateThe state for the login (optional)
Returns
The started email login model
logInWithPhoneNumber(PhoneNumber, boolean, String, String)

Starts the phone login by sending an SMS to the given phone number

To ensure thread safety please call this from the UI thread

If an account is already logged in. Calling this method will cause that account to be logged out.

public static PhoneLoginModel logInWithPhoneNumber(PhoneNumber phoneNumber, boolean sendWithFacebookNotification, String responseType, String initialAuthState)
ParameterDescription
phoneNumberPhone number to authenticate
sendWithFacebookNotificationIf this is sent via facebook notification
responseTypeThe response type expected
initialAuthStateThe state for the login (optional)
Returns
The started phone login model
logOut()

Initiates logOut using the currently stored Access Token and Account

public static void logOut()
cancelLogin()

Cancels the current login, if one exists

To ensure thread safety please call this from the UI thread

public static void cancelLogin()
cancelLogin(AccountKitCallback)

Cancels the current login, if one exists

To ensure thread safety please call this from the UI thread

public static void cancelLogin(AccountKitCallback callback)
ParameterDescription
callbackAn optional callback when the cancel operation finishes
continueLoginWithCode(String)

Begins the verification process for the confirmation code

To ensure thread safety please call this from the UI thread

public static void continueLoginWithCode(String code)
ParameterDescription
codeThe sms confirmation code
getCurrentAccessToken()

Getter for the access token that is current for the application.

public static AccessToken getCurrentAccessToken()
Returns
The access token that is current for the application.
getAccountPreferences()

Returns an instance of account preferences for the current access token.

public static AccountPreferences getAccountPreferences()
Returns
A new AccountPreferences object.
getCurrentAccount(AccountKitCallback)

Starts a request to get the current account. Can only be called when there is a current access token available

You should call this at least as often as AccessToken.getTokenRefreshIntervalSeconds to keep your access token from expiring. We recommend every time that the app starts up.

public static void getCurrentAccount(AccountKitCallback callback)
ParameterDescription
callbackCallback to invoke when the account is retrieved
getCurrentEmailLogInModel()
public static EmailLoginModel getCurrentEmailLogInModel()
Returns
The current email login model, if it exists
getCurrentPhoneNumberLogInModel()
public static PhoneLoginModel getCurrentPhoneNumberLogInModel()
Returns
The current phone number login, if it exists
onActivityCreate(Activity, Bundle)

Called when the calling activity is created

public static void onActivityCreate(Activity activity, Bundle savedInstanceState)
ParameterDescription
activityThe activity
savedInstanceStateThe saved instance state
onActivityDestroy(Activity)

Called when the calling activity is destroyed

public static void onActivityDestroy(Activity activity)
ParameterDescription
activityThe activity
onActivitySaveInstanceState(Activity, Bundle)

Called on the calling activity saved state

public static void onActivitySaveInstanceState(Activity activity, Bundle outState)
ParameterDescription
activityThe activity
outStateThe out state
getApplicationId()

Gets the Facebook application ID for the current app. This should only be called after the SDK has been initialized by calling AccountKit.initialize().

public static String getApplicationId()
Returns
The application ID
getApplicationName()

Gets the Account Kit application Name for the current app. This should only be called after the SDK has been initialized by calling AccountKit.initialize().

public static String getApplicationName()
Returns
The application Name
getClientToken()

Gets the client token for the current app. This should only be called after the SDK has been initialized by calling AccountKit.initialize().

public static String getClientToken()
Returns
The client token
getAccountKitFacebookAppEventsEnabled()

Gets if Account Kit SDK will log to Facebook App Events or not. This is only true if Facebook SDK is integrated and com.facebook.accountkit.AccountKitFacebookAppEventsEnabled is not specified as true in the manifest. To turn off logging to Facebook App Events, com.facebook.accountkit.LogFacebookAppEvents must be set to false in the manifest.

public static boolean getAccountKitFacebookAppEventsEnabled()
Returns
True if Facebook App Events will be logged, false otherwise
Constants
APPLICATION_ID_PROPERTY
The key for the Facebook application ID in the Android manifest.
public static final String APPLICATION_ID_PROPERTY
APPLICATION_NAME_PROPERTY
The key for the AccountKit application name in the Android manifest.
public static final String APPLICATION_NAME_PROPERTY
CLIENT_TOKEN_PROPERTY
The key for the AccountKit client token in the Android manifest.
public static final String CLIENT_TOKEN_PROPERTY
FACEBOOK_APP_EVENTS_ENABLED_PROPERTY
The key for setting if Account Kit events will be logged to Facebook App Events when Facebook SDK is integrated. The default behavior is to log to Facebook App Events if this property is not specified.
public static final String FACEBOOK_APP_EVENTS_ENABLED_PROPERTY