@@ -150,9 +150,9 @@ startActivityForResult(
150
150
AuthUI . getInstance()
151
151
.createSignInIntentBuilder()
152
152
.setProviders(
153
- AuthUI . EMAIL_PROVIDER ,
154
- AuthUI . GOOGLE_PROVIDER ,
155
- AuthUI . FACEBOOK_PROVIDER )
153
+ new IdpConfig . Builder ( AuthUI . EMAIL_PROVIDER) . build() ,
154
+ new IdpConfig . Builder ( AuthUI . GOOGLE_PROVIDER) . build() ,
155
+ new IdpConfig . Builder ( AuthUI . FACEBOOK_PROVIDER) . build() )
156
156
.build(),
157
157
RC_SIGN_IN );
158
158
```
@@ -367,35 +367,55 @@ redefine a string to change it, for example:
367
367
368
368
#### Google
369
369
By default, FirebaseUI requests the `email` and `profile` scopes when using Google Sign In. If you
370
- would like to request additional scopes from the user, add a string array resource named
371
- `google_permissions` to your `strings.xml` file like this:
370
+ would like to request additional scopes from the user, call `setPermissions` on the
371
+ `AuthUI.IdpConfig.Builder` when initializing FirebaseUI.
372
372
373
- ```xml
374
- <!--
375
- For a list of all scopes, see:
376
- https://developers.google.com/identity/protocols/googlescopes
377
- -->
378
- <string-array name="google_permissions">
379
- <!-- Request permission to read the user's Google Drive files -->
380
- <item>https://www.googleapis.com/auth/drive.readonly</item>
381
- </string-array>
373
+
374
+ ```java
375
+ // For a list of all scopes, see:
376
+ // https://developers.google.com/identity/protocols/googlescopes
377
+ AuthUI .IdpConfig googleIdp = new AuthUI .IdpConfig .Builder (AuthUI . GOOGLE_PROVIDER )
378
+ .setPermissions(Arrays . asList(Scopes . GAMES ))
379
+ .build();
380
+
381
+ startActivityForResult(
382
+ AuthUI . getInstance()
383
+ .createSignInIntentBuilder()
384
+ .setProviders(
385
+ new IdpConfig .Builder (AuthUI . EMAIL_PROVIDER ). build(),
386
+ googleIdp,
387
+ new IdpConfig .Builder (AuthUI . FACEBOOK_PROVIDER ). build())
388
+ .build(),
389
+ RC_SIGN_IN );
382
390
```
383
391
384
392
385
393
#### Facebook
386
394
387
395
By default, FirebaseUI requests the ` email ` and ` public_profile ` permissions when initiating
388
- Facebook Login. If you would like to override these scopes, a string array resource named
389
- `facebook_permissions` to your `strings.xml` file like this:
396
+ Facebook Login. If you would like to request additional permissions from the user, call
397
+ ` setPermissions ` on the ` AuthUI.IdpConfig.Builder ` when initializing FirebaseUI.
390
398
391
- ```xml
392
- <!--
393
- See:
394
- https://developers.facebook.com/docs/facebook-login/android
395
- https://developers.facebook.com/docs/facebook-login/permissions
396
- -->
397
- <string-array name="facebook_permissions">
398
- <!-- Request permission to know the user's birthday -->
399
- <item>user_birthday</item>
400
- </string-array>
399
+ ``` java
400
+ // For a list of permissions see:
401
+ // https://developers.facebook.com/docs/facebook-login/android
402
+ // https://developers.facebook.com/docs/facebook-login/permissions
403
+
404
+ AuthUI . IdpConfig facebookIdp = new AuthUI .IdpConfig .Builder (AuthUI . FACEBOOK_PROVIDER )
405
+ .setPermissions(Arrays . asList(" user_friends" ))
406
+ .build();
407
+
408
+ startActivityForResult(
409
+ AuthUI . getInstance()
410
+ .createSignInIntentBuilder()
411
+ .setProviders(
412
+ new IdpConfig .Builder (AuthUI . EMAIL_PROVIDER ). build(),
413
+ new IdpConfig .Builder (AuthUI . GOOGLE_PROVIDER ). build(),
414
+ facebookIdp)
415
+ .build(),
416
+ RC_SIGN_IN );
401
417
```
418
+
419
+ #### Twitter
420
+
421
+ Twitter permissions can only be configured through Twitter's developer console.
0 commit comments