Package com.firebase.ui.auth
Class AuthUI.IdpConfig.PhoneBuilder
- java.lang.Object
-
- com.firebase.ui.auth.AuthUI.IdpConfig.Builder
-
- com.firebase.ui.auth.AuthUI.IdpConfig.PhoneBuilder
-
- Enclosing class:
- AuthUI.IdpConfig
public static final class AuthUI.IdpConfig.PhoneBuilder extends AuthUI.IdpConfig.Builder
AuthUI.IdpConfigbuilder for the phone provider.
-
-
Constructor Summary
Constructors Constructor Description PhoneBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthUI.IdpConfigbuild()AuthUI.IdpConfig.PhoneBuildersetBlacklistedCountries(java.util.List<java.lang.String> blacklistedCountries)Sets the countries to be removed from the country code selector for phone authentication.AuthUI.IdpConfig.PhoneBuildersetDefaultCountryIso(java.lang.String iso)Set the default country code that will be used in the phone verification sign-in flow.AuthUI.IdpConfig.PhoneBuildersetDefaultNumber(java.lang.String number)AuthUI.IdpConfig.PhoneBuildersetDefaultNumber(java.lang.String iso, java.lang.String number)Set the default phone number that will be used to populate the phone verification sign-in flow.AuthUI.IdpConfig.PhoneBuildersetWhitelistedCountries(java.util.List<java.lang.String> whitelistedCountries)Sets the country codes available in the country code selector for phone authentication.-
Methods inherited from class com.firebase.ui.auth.AuthUI.IdpConfig.Builder
getParams, setProviderId
-
-
-
-
Method Detail
-
setDefaultNumber
@NonNull public AuthUI.IdpConfig.PhoneBuilder setDefaultNumber(@NonNull java.lang.String number)
- Parameters:
number- the phone number in international format- See Also:
setDefaultNumber(String, String)
-
setDefaultNumber
@NonNull public AuthUI.IdpConfig.PhoneBuilder setDefaultNumber(@NonNull java.lang.String iso, @NonNull java.lang.String number)
Set the default phone number that will be used to populate the phone verification sign-in flow.- Parameters:
iso- the phone number's country codenumber- the phone number in local format
-
setDefaultCountryIso
@NonNull public AuthUI.IdpConfig.PhoneBuilder setDefaultCountryIso(@NonNull java.lang.String iso)
Set the default country code that will be used in the phone verification sign-in flow.- Parameters:
iso- country iso
-
setWhitelistedCountries
public AuthUI.IdpConfig.PhoneBuilder setWhitelistedCountries(@NonNull java.util.List<java.lang.String> whitelistedCountries)
Sets the country codes available in the country code selector for phone authentication. Takes as input a List of both country isos and codes. This is not to be called withsetBlacklistedCountries(List). If both are called, an exception will be thrown.Inputting an e-164 country code (e.g. '+1') will include all countries with +1 as its code. Example input: {'+52', 'us'} For a list of country iso or codes, see Alpha-2 isos here: https://en.wikipedia.org/wiki/ISO_3166-1 and e-164 codes here: https://en.wikipedia.org/wiki/List_of_country_calling_codes
- Parameters:
whitelistedCountries- a non empty case insensitive list of country codes and/or isos to be whitelisted- Throws:
java.lang.IllegalArgumentException- if an empty whitelist is provided.java.lang.NullPointerException- if a null whitelist is provided.
-
setBlacklistedCountries
public AuthUI.IdpConfig.PhoneBuilder setBlacklistedCountries(@NonNull java.util.List<java.lang.String> blacklistedCountries)
Sets the countries to be removed from the country code selector for phone authentication. Takes as input a List of both country isos and codes. This is not to be called withsetWhitelistedCountries(List). If both are called, an exception will be thrown.Inputting an e-164 country code (e.g. '+1') will include all countries with +1 as its code. Example input: {'+52', 'us'} For a list of country iso or codes, see Alpha-2 codes here: https://en.wikipedia.org/wiki/ISO_3166-1 and e-164 codes here: https://en.wikipedia.org/wiki/List_of_country_calling_codes
- Parameters:
blacklistedCountries- a non empty case insensitive list of country codes and/or isos to be blacklisted- Throws:
java.lang.IllegalArgumentException- if an empty blacklist is provided.java.lang.NullPointerException- if a null blacklist is provided.
-
build
public AuthUI.IdpConfig build()
- Overrides:
buildin classAuthUI.IdpConfig.Builder
-
-