public final class AccountKit
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
AccountKit.InitializeCallback
Callback passed to the initialize function.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APPLICATION_ID_PROPERTY
The key for the Facebook application ID in the Android manifest.
|
static java.lang.String |
APPLICATION_NAME_PROPERTY
The key for the AccountKit application name in the Android manifest.
|
static java.lang.String |
CLIENT_TOKEN_PROPERTY
The key for the AccountKit client token in the Android manifest.
|
static java.lang.String |
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.
|
Constructor and Description |
---|
AccountKit() |
Modifier and Type | Method and Description |
---|---|
static void |
cancelLogin()
Cancels the current login, if one exists
To ensure thread safety please call this from the UI thread
|
static boolean |
getAccountKitFacebookAppEventsEnabled()
Gets if Account Kit SDK will log to Facebook App Events or not.
|
static AccountPreferences |
getAccountPreferences()
Returns an instance of account preferences for the current access token.
|
static java.lang.String |
getApplicationId()
Gets the Facebook application ID for the current app.
|
static java.lang.String |
getApplicationName()
Gets the Account Kit application Name for the current app.
|
static java.lang.String |
getClientToken()
Gets the client token for the current app.
|
static AccessToken |
getCurrentAccessToken()
Getter for the access token that is current for the application.
|
static void |
getCurrentAccount(AccountKitCallback<Account> callback)
Starts a request to get the current account.
|
static EmailLoginModel |
getCurrentEmailLogInModel() |
static PhoneLoginModel |
getCurrentPhoneNumberLogInModel() |
static java.util.concurrent.Executor |
getExecutor()
Returns the Executor used by the SDK.
|
static LoggingBehaviorCollection |
getLoggingBehaviors()
The console logging behaviors, which can be configured for debugging.
|
static void |
initialize(android.content.Context applicationContext)
This function initializes the AccountKit SDK, the behavior of AccountKit SDK functions
are undetermined if this function is not called.
|
static void |
initialize(android.content.Context applicationContext,
AccountKit.InitializeCallback callback)
This function initializes the AccountKit SDK, the behavior of AccountKit SDK functions
are undetermined if this function is not called.
|
static boolean |
isInitialized()
Indicates whether the AccountKit SDK has been initialized.
|
static AccountKitLoginResult |
loginResultWithIntent(android.content.Intent data) |
static EmailLoginModel |
logInWithEmail(java.lang.String email,
java.lang.String responseType,
java.lang.String initialAuthState)
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.
|
static PhoneLoginModel |
logInWithPhoneNumber(PhoneNumber phoneNumber,
boolean sendWithFacebookNotification,
java.lang.String responseType,
java.lang.String initialAuthState)
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.
|
static void |
logOut()
Initiates logOut using the currently stored Access Token and Account
|
static void |
onActivityCreate(android.app.Activity activity,
android.os.Bundle savedInstanceState)
Called when the calling activity is created
|
static void |
onActivityDestroy(android.app.Activity activity)
Called when the calling activity is destroyed
|
static void |
onActivitySaveInstanceState(android.app.Activity activity,
android.os.Bundle outState)
Called on the calling activity saved state
|
static void |
setExecutor(java.util.concurrent.Executor executor)
Sets the Executor used by the SDK.
|
public static final java.lang.String APPLICATION_ID_PROPERTY
public static final java.lang.String APPLICATION_NAME_PROPERTY
public static final java.lang.String CLIENT_TOKEN_PROPERTY
public static final java.lang.String FACEBOOK_APP_EVENTS_ENABLED_PROPERTY
public static LoggingBehaviorCollection getLoggingBehaviors()
public static boolean isInitialized()
public static void initialize(android.content.Context applicationContext)
applicationContext
- The application contextpublic static void initialize(android.content.Context applicationContext, AccountKit.InitializeCallback callback)
applicationContext
- The application contextcallback
- A callback called when initialize finishes.
This will be called even if the sdk is already initialized.public static EmailLoginModel logInWithEmail(java.lang.String email, java.lang.String responseType, @Nullable java.lang.String initialAuthState)
email
- the email to use for loginresponseType
- the response type expectedinitialAuthState
- the state for the login (optional)public static PhoneLoginModel logInWithPhoneNumber(PhoneNumber phoneNumber, boolean sendWithFacebookNotification, java.lang.String responseType, @Nullable java.lang.String initialAuthState)
phoneNumber
- phone number to authenticatesendWithFacebookNotification
- if this is sent via facebook notificationresponseType
- the response type expectedinitialAuthState
- the state for the login (optional)public static void logOut()
public static void cancelLogin()
@Nullable public static AccessToken getCurrentAccessToken()
@Nullable public static AccountPreferences getAccountPreferences()
public static void getCurrentAccount(AccountKitCallback<Account> callback)
callback
- Callback to invoke when the account is retrievedpublic static EmailLoginModel getCurrentEmailLogInModel()
public static PhoneLoginModel getCurrentPhoneNumberLogInModel()
public static void onActivityCreate(android.app.Activity activity, android.os.Bundle savedInstanceState)
activity
- the activitysavedInstanceState
- the saved instance statepublic static void onActivityDestroy(android.app.Activity activity)
activity
- the activitypublic static void onActivitySaveInstanceState(android.app.Activity activity, android.os.Bundle outState)
activity
- the activityoutState
- the out statepublic static java.lang.String getApplicationId()
public static java.lang.String getApplicationName()
public static java.lang.String getClientToken()
public static boolean getAccountKitFacebookAppEventsEnabled()
public static java.util.concurrent.Executor getExecutor()
public static void setExecutor(java.util.concurrent.Executor executor)
executor
- an Executor to be used by the SDK@Nullable public static AccountKitLoginResult loginResultWithIntent(android.content.Intent data)