@@ -62,7 +62,7 @@ Gradle, add the dependency:
6262``` groovy
6363dependencies {
6464 // ...
65- implementation 'com.firebaseui:firebase-ui-auth:3.1.3 '
65+ implementation 'com.firebaseui:firebase-ui-auth:3.2.0 '
6666
6767 // Required only if Facebook login support is required
6868 // Find the latest Facebook SDK releases here: https://goo.gl/Ce5L94
@@ -216,16 +216,16 @@ You can enable sign-in providers like Google Sign-In or Facebook Log In by calli
216216
217217``` java
218218startActivityForResult(
219- AuthUI . getInstance()
220- .createSignInIntentBuilder()
221- .setAvailableProviders(
222- Arrays . asList( new AuthUI .IdpConfig .Builder ( AuthUI . EMAIL_PROVIDER ). build(),
223- new AuthUI .IdpConfig .Builder ( AuthUI . PHONE_VERIFICATION_PROVIDER ). build(),
224- new AuthUI .IdpConfig .Builder ( AuthUI . GOOGLE_PROVIDER ). build(),
225- new AuthUI .IdpConfig .Builder ( AuthUI . FACEBOOK_PROVIDER ). build(),
226- new AuthUI .IdpConfig .Builder ( AuthUI . TWITTER_PROVIDER ). build()))
227- .build(),
228- RC_SIGN_IN );
219+ AuthUI . getInstance()
220+ .createSignInIntentBuilder()
221+ .setAvailableProviders( Arrays . asList (
222+ new AuthUI .IdpConfig .EmailBuilder ( ). build(),
223+ new AuthUI .IdpConfig .PhoneBuilder ( ). build(),
224+ new AuthUI .IdpConfig .GoogleBuilder ( ). build(),
225+ new AuthUI .IdpConfig .FacebookBuilder ( ). build(),
226+ new AuthUI .IdpConfig .TwitterBuilder ( ). build()))
227+ .build(),
228+ RC_SIGN_IN );
229229```
230230
231231##### Adding a ToS and privacy policy
@@ -260,28 +260,30 @@ startActivityForResult(
260260 RC_SIGN_IN );
261261```
262262
263- It is often desirable to disable Smart Lock in development but enable it in production. To achieve
264- this, you can use the ` BuildConfig.DEBUG ` flag to control Smart Lock:
263+ ###### Smart Lock hints
264+
265+ If you'd like to keep Smart Lock's "hints" but disable the saving/retrieving of credentials, then
266+ you can use the two-argument version of ` setIsSmartLockEnabled ` :
265267
266268``` java
267269startActivityForResult(
268270 AuthUI . getInstance()
269271 .createSignInIntentBuilder()
270- .setIsSmartLockEnabled(! BuildConfig . DEBUG )
272+ .setIsSmartLockEnabled(false , true )
271273 .build(),
272274 RC_SIGN_IN );
273275```
274276
275- ###### Smart Lock hints
277+ ###### Smart Lock in dev builds
276278
277- If you'd like to keep Smart Lock's "hints" but disable the saving/retrieving of credentials, then
278- you can use the two-argument version of ` setIsSmartLockEnabled ` :
279+ It is often desirable to disable Smart Lock in development but enable it in production. To achieve
280+ this, you can use the ` BuildConfig.DEBUG ` flag to control Smart Lock :
279281
280282``` java
281283startActivityForResult(
282284 AuthUI . getInstance()
283285 .createSignInIntentBuilder()
284- .setIsSmartLockEnabled(false , true )
286+ .setIsSmartLockEnabled(! BuildConfig . DEBUG /* credentials */ , true /* hints */ )
285287 .build(),
286288 RC_SIGN_IN );
287289```
@@ -293,27 +295,27 @@ provide a default phone number (in international format) that will be used to pr
293295country code and phone number input fields. The user is still able to edit the number if desired.
294296
295297``` java
296- // Use a Bundle to hold the default number, and pass it to the Builder via setParams:
297- Bundle params = new Bundle ();
298- params. putString(AuthUI . EXTRA_DEFAULT_PHONE_NUMBER , " +123456789" );
299- IdpConfig phoneConfigWithDefaultNumber =
300- new IdpConfig .Builder (AuthUI . PHONE_VERIFICATION_PROVIDER )
301- .setParams(params)
302- .build();
298+ IdpConfig phoneConfigWithDefaultNumber = new IdpConfig .PhoneBuilder ()
299+ .setDefaultNumber(" +123456789" )
300+ .build();
301+ ```
302+
303+ Alternatively, you can set only the default phone number country.
304+
305+ ``` java
306+ IdpConfig phoneConfigWithDefaultNumber = new IdpConfig .PhoneBuilder ()
307+ .setDefaultCountryIso(" ca" )
308+ .build();
303309```
304310
305311It is also possible to set a default country code along with a national number if a specific country
306312is your app's target audience. This will take precedence over the full default phone number if both
307313are provided.
308314
309315``` java
310- Bundle params = new Bundle ();
311- params. putString(AuthUI . EXTRA_DEFAULT_COUNTRY_CODE , " ca" );
312- params. putString(AuthUI . EXTRA_DEFAULT_NATIONAL_NUMBER , " 23456789" );
313- IdpConfig phoneConfigWithDefaultCountryAndNationalNumber =
314- new IdpConfig .Builder (AuthUI . PHONE_VERIFICATION_PROVIDER )
315- .setParams(params)
316- .build();
316+ IdpConfig phoneConfigWithDefaultNumber = new IdpConfig .PhoneBuilder ()
317+ .setDefaultNumber(" ca" , " 23456789" )
318+ .build();
317319```
318320
319321### Handling the sign-in response
@@ -561,50 +563,46 @@ at a diff of the `strings.xml` file before updating FirebaseUI.
561563
562564### Google
563565By default, FirebaseUI requests the ` email ` and ` profile ` scopes when using Google Sign-In. If you
564- would like to request additional scopes from the user, call ` setPermissions ` on the
565- ` AuthUI.IdpConfig.Builder ` when initializing FirebaseUI.
566+ would like to request additional scopes from the user, call ` setScopes ` on the
567+ ` AuthUI.IdpConfig.GoogleBuilder ` when initializing FirebaseUI.
566568
567569
568570``` java
569571// For a list of all scopes, see:
570572// https://developers.google.com/identity/protocols/googlescopes
571- AuthUI . IdpConfig googleIdp = new AuthUI .IdpConfig .Builder ( AuthUI . GOOGLE_PROVIDER )
572- .setPermissions (Arrays . asList(Scopes . GAMES ))
573- .build();
573+ AuthUI . IdpConfig googleIdp = new AuthUI .IdpConfig .GoogleBuilder ( )
574+ .setScopes (Arrays . asList(Scopes . GAMES ))
575+ .build();
574576
575577startActivityForResult(
576- AuthUI . getInstance()
577- .createSignInIntentBuilder()
578- .setAvailableProviders(Arrays . asList(new IdpConfig .Builder (AuthUI . EMAIL_PROVIDER ). build(),
579- googleIdp,
580- new IdpConfig .Builder (AuthUI . FACEBOOK_PROVIDER ). build()))
581- .build(),
582- RC_SIGN_IN );
578+ AuthUI . getInstance()
579+ .createSignInIntentBuilder()
580+ .setAvailableProviders(Arrays . asList(googleIdp, ... ))
581+ .build(),
582+ RC_SIGN_IN );
583583```
584584
585585
586586### Facebook
587587
588588By default, FirebaseUI requests the ` email ` and ` public_profile ` permissions when initiating
589589Facebook Login. If you would like to request additional permissions from the user, call
590- ` setPermissions ` on the ` AuthUI.IdpConfig.Builder ` when initializing FirebaseUI.
590+ ` setPermissions ` on the ` AuthUI.IdpConfig.FacebookBuilder ` when initializing FirebaseUI.
591591
592592``` java
593593// For a list of permissions see:
594- // https://developers.facebook.com/docs/facebook-login/android
595594// https://developers.facebook.com/docs/facebook-login/permissions
596595
597- AuthUI . IdpConfig facebookIdp = new AuthUI .IdpConfig .Builder ( AuthUI . FACEBOOK_PROVIDER )
598- .setPermissions(Arrays . asList(" user_friends" ))
599- .build();
596+ AuthUI . IdpConfig facebookIdp = new AuthUI .IdpConfig .FacebookBuilder ( )
597+ .setPermissions(Arrays . asList(" user_friends" ))
598+ .build();
600599
601600startActivityForResult(
602- AuthUI . getInstance()
603- .createSignInIntentBuilder()
604- .setAvailableProviders(Arrays . asList(new AuthUI .IdpConfig .Builder (AuthUI . EMAIL_PROVIDER ). build(),
605- facebookIdp))
606- .build(),
607- RC_SIGN_IN );
601+ AuthUI . getInstance()
602+ .createSignInIntentBuilder()
603+ .setAvailableProviders(Arrays . asList(facebookIdp, ... ))
604+ .build(),
605+ RC_SIGN_IN );
608606```
609607
610608### Twitter
0 commit comments