The AccountKitConfigurationBuilder Object

The AccountKitConfigurationBuilder object offers multiple UI and behavior customization points for your use of Account Kit via methods that allow you to override default properties at runtime.

MethodDescription

setInitialAuthState(String initialAuthState)

(Optional) A developer-generated nonce used to verify that the received response matches the request. Fill this with a random value at runtime; when the login call returns, check that the corresponding param in the response matches the one you set in this method.

setInitialEmail(String initialEmail)

(Optional) Pre-fill the user's email address in the email login flow.

Note: By default, the email field provides a dropdown list of the user's email addresses if the GET_ACCOUNTS permission is granted.

setDefaultCountryCode(String defaultCountryCode)

(Optional) Set the default country code shown in the SMS login flow.

setInitialPhoneNumber(PhoneNumber initialPhoneNumber)

(Optional) Pre-fill the user's phone number in the SMS login flow.

setFacebookNotificationsEnabled(boolean facebookNotificationsEnabled)

(Optional) If this flag is set, Account Kit offers the user the option to receive their confirmation message via a Facebook notification in the event of an SMS failure, if their phone number is associated with their Facebook account. The associated phone number must be the primary phone number for that Facebook account.

Default: true

setTitleType(AccountKitActivity.TitleType titleType)

(Optional) Set to AccountKitActivity.TitleType.APP_NAME to use your application's name as the title for the login screen, or AccountKitActivity.TitleType.LOGIN to use a localized translation of "Login" as the title.

Default: AccountKitActivity.TitleType.LOGIN

setTheme(int theme)

(Optional) Pass in a resource identifier for a theme to have that theme used for the login screen. See Customizing the UI for Android for more information.

Note: If you specify both a theme and an Advanced UI Manager object (see below), the Advanced UI Manager will take precedence and overwrite theme elements.

setAdvancedUIManager(AdvancedUIManager advancedUIManager)

(Optional) Pass in an object that implements the AdvancedUIManager protocol. See Customizing the UI for Android for more information.

setReadPhoneStateEnabled(boolean readPhoneStateEnabled)

(Optional) If the READ_PHONE_STATE permission is granted and this flag is true, the app will pre-fill the user's phone number in the SMS login flow. Set to false if you wish to use the READ_PHONE_STATE permission yourself, but you do not want the user's phone number pre-filled by Account Kit.

Default: true

setReceiveSMS(boolean receiveSMSEnabled)

(Optional) If the RECEIVE_SMS permission is granted and this flag is true, the app will automatically read the Account Kit confirmation SMS and pre-fill the confirmation code in the SMS login flow. Set to false if you wish to use the RECEIVE_SMS permission yourself, but you do not want the SMS confirmation code pre-filled by Account Kit.

Default: true

setSMSWhitelist(String[] smsWhitelist)

(Optional) Use this to specify a list of permitted country codes for use in the SMS login flow. The value is an array of short country codes as defined by ISO 3166-1 Alpha 2. To restrict availability to just the US (+1) and The Netherlands (+31), pass in ["US", "NL"].

setSMSBlacklist(String[] smsBlacklist)

(Optional) Use this to specify a list of country codes to exclude during the SMS login flow. Only the country codes in the blacklist are unavailable. People can still use the rest of Account Kit's supported country codes. If a country code appears in both the whitelist and the blacklist, the blacklist takes precedence and the country code is not available. Just like the whitelist, the value is an array of short country codes as defined by ISO 3166-1 Alpha 2.

When you whitelist and blacklist country codes, you can use the following combinations of lists with the described results.

Lists Result

No whitelist or blacklist

All country codes supported by Account Kit are available.

Whilelist

Only country codes in the whitelist are available.

Blacklist

All country codes supported by Account Kit except those in the blacklist are available.

Whitelist and blacklist

Only the country codes in the whitelist that are not also in the blacklist are available. Note that the blacklist takes priority for codes that that are in both lists.