Skip to content

Commit 6654523

Browse files
author
Aaron Mandle
committed
Update the README to reflect the new API changes
1 parent 85f16cd commit 6654523

File tree

2 files changed

+47
-27
lines changed

2 files changed

+47
-27
lines changed

auth/README.md

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ startActivityForResult(
150150
AuthUI.getInstance()
151151
.createSignInIntentBuilder()
152152
.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())
156156
.build(),
157157
RC_SIGN_IN);
158158
```
@@ -367,35 +367,55 @@ redefine a string to change it, for example:
367367

368368
#### Google
369369
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.
372372

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);
382390
```
383391

384392

385393
#### Facebook
386394

387395
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.
390398

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);
401417
```
418+
419+
#### Twitter
420+
421+
Twitter permissions can only be configured through Twitter's developer console.

auth/src/main/java/com/firebase/ui/auth/AuthUI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ public Builder(@NonNull String providerId) {
496496
* For Google permissions see:
497497
* https://developers.google.com/identity/protocols/googlescopes
498498
*
499-
* Twitter scopes are only configurable through the Twitter developer console.
499+
* Twitter permissions are only configurable through the Twitter developer console.
500500
*/
501501
public Builder setPermissions(List<String> permissions) {
502502
mScopes = permissions;

0 commit comments

Comments
 (0)