Skip to content

Commit

Permalink
Version 6.1.0
Browse files Browse the repository at this point in the history
Version 6.1.0
  • Loading branch information
samtstern authored Nov 14, 2019
2 parents 3fab6d5 + 81655ff commit d78e72b
Show file tree
Hide file tree
Showing 147 changed files with 2,395 additions and 245 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ libraries.
```groovy
dependencies {
// FirebaseUI for Firebase Realtime Database
implementation 'com.firebaseui:firebase-ui-database:6.0.2'
implementation 'com.firebaseui:firebase-ui-database:6.1.0'
// FirebaseUI for Cloud Firestore
implementation 'com.firebaseui:firebase-ui-firestore:6.0.2'
implementation 'com.firebaseui:firebase-ui-firestore:6.1.0'
// FirebaseUI for Firebase Auth
implementation 'com.firebaseui:firebase-ui-auth:6.0.2'
implementation 'com.firebaseui:firebase-ui-auth:6.1.0'
// FirebaseUI for Cloud Storage
implementation 'com.firebaseui:firebase-ui-storage:6.0.2'
implementation 'com.firebaseui:firebase-ui-storage:6.1.0'
}
```

Expand Down
18 changes: 18 additions & 0 deletions app/src/main/java/com/firebase/uidemo/auth/AuthUiActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ public class AuthUiActivity extends AppCompatActivity {
@BindView(R.id.email_link_provider) CheckBox mUseEmailLinkProvider;
@BindView(R.id.phone_provider) CheckBox mUsePhoneProvider;
@BindView(R.id.anonymous_provider) CheckBox mUseAnonymousProvider;
@BindView(R.id.apple_provider) CheckBox mUseAppleProvider;
@BindView(R.id.microsoft_provider) CheckBox mUseMicrosoftProvider;
@BindView(R.id.yahoo_provider) CheckBox mUseYahooProvider;

@BindView(R.id.default_layout) RadioButton mDefaultLayout;
@BindView(R.id.custom_layout) RadioButton mCustomLayout;
Expand Down Expand Up @@ -182,6 +185,9 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
mUseEmailLinkProvider.setChecked(false);
mUsePhoneProvider.setChecked(false);
mUseAnonymousProvider.setChecked(false);
mUseMicrosoftProvider.setChecked(false);
mUseYahooProvider.setChecked(false);
mUseAppleProvider.setChecked(false);
}
}
});
Expand Down Expand Up @@ -421,6 +427,18 @@ private List<IdpConfig> getSelectedProviders() {
selectedProviders.add(new IdpConfig.AnonymousBuilder().build());
}

if (mUseMicrosoftProvider.isChecked()) {
selectedProviders.add(new IdpConfig.MicrosoftBuilder().build());
}

if (mUseYahooProvider.isChecked()) {
selectedProviders.add(new IdpConfig.YahooBuilder().build());
}

if (mUseAppleProvider.isChecked()) {
selectedProviders.add(new IdpConfig.AppleBuilder().build());
}

return selectedProviders;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ private void populateProfile(@Nullable IdpResponse response) {
// Ignore this provider, it's not very meaningful
break;
default:
throw new IllegalStateException(
"Unknown provider: " + info.getProviderId());
providers.add(info.getProviderId());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ public static List<AuthUI.IdpConfig> getConfiguredProviders(@NonNull Context con


providers.add(new AuthUI.IdpConfig.PhoneBuilder().build());

providers.add(new AuthUI.IdpConfig.MicrosoftBuilder().build());
providers.add(new AuthUI.IdpConfig.YahooBuilder().build());
providers.add(new AuthUI.IdpConfig.AppleBuilder().build());

return providers;
}
Expand Down
21 changes: 21 additions & 0 deletions app/src/main/res/layout/auth_ui_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,27 @@
android:checked="true"
android:text="@string/providers_anonymous" />

<CheckBox
android:id="@+id/apple_provider"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/providers_apple" />

<CheckBox
android:id="@+id/microsoft_provider"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/providers_microsoft" />

<CheckBox
android:id="@+id/yahoo_provider"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/providers_yahoo" />

<TextView
style="@style/Base.TextAppearance.AppCompat.Subhead"
android:layout_width="wrap_content"
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<string name="providers_email_link">Email link</string>
<string name="providers_phone">Phone</string>
<string name="providers_anonymous">Anonymous</string>
<string name="providers_apple">Apple</string>
<string name="providers_microsoft">Microsoft</string>
<string name="providers_yahoo">Yahoo</string>

<string name="layout_header">Layout</string>
<string name="layout_default">Default</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.firebase.ui.auth.util.ExtraConstants;
import com.firebase.ui.auth.viewmodel.ProviderSignInBase;
import com.firebase.ui.auth.viewmodel.RequestCodes;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.GithubAuthProvider;

import java.util.ArrayList;
Expand Down Expand Up @@ -183,4 +184,11 @@ private interface GitHubApi {
@GET("user")
Call<GitHubProfile> getUser(@Header("Authorization") String token);
}

@Override
public void startSignIn(@NonNull FirebaseAuth auth,
@NonNull HelperActivityBase activity,
@NonNull String providerId) {
startSignIn(activity);
}
}
37 changes: 34 additions & 3 deletions auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Gradle, add the dependency:
```groovy
dependencies {
// ...
implementation 'com.firebaseui:firebase-ui-auth:6.0.2'
implementation 'com.firebaseui:firebase-ui-auth:6.1.0'
// Required only if Facebook login support is required
// Find the latest Facebook SDK releases here: https://goo.gl/Ce5L94
Expand Down Expand Up @@ -97,8 +97,8 @@ for more information.

### Identity provider configuration

In order to use either Google, Facebook or Twitter accounts with your app, ensure that
these authentication methods are first configured in the Firebase console.
In order to use either Google, Facebook, Twitter, Microsoft, Apple, or Yahoo accounts with your
app, ensure that these authentication methods are first configured in the Firebase console.

#### Google

Expand Down Expand Up @@ -148,6 +148,34 @@ allprojects {
}
```

#### Microsoft, Apple, and Yahoo

No FirebaseUI configuration is required for these providers.

We support the use of scopes and custom parameters for these providers. For example:

```java
List<String> scopes =
new ArrayList<String>() {
{
add("mail.read");
add("calendars.read");
}
};

Map<String, String> customParams = new HashMap<>();
customParams.put("tenant", "TENANT_ID");

IdpConfig microsoftConfig = new IdpConfig.MicrosoftBuilder()
.setScopes(scopes)
.setCustomParameters(customParams)
.build();
selectedProviders.add(microsoftConfig);
```

Note: unlike other sign-in methods, signing in with these providers involves the use of a
[Custom Chrome Tab](https://developer.chrome.com/multidevice/android/customtabs).

#### GitHub

We do not currently support Github as a sign-in method in FirebaseUI on Android. The current
Expand Down Expand Up @@ -236,6 +264,9 @@ startActivityForResult(
new AuthUI.IdpConfig.GoogleBuilder().build(),
new AuthUI.IdpConfig.FacebookBuilder().build(),
new AuthUI.IdpConfig.TwitterBuilder().build(),
new AuthUI.IdpConfig.MicrosoftBuilder().build(),
new AuthUI.IdpConfig.YahooBuilder().build(),
new AuthUI.IdpConfig.AppleBuilder().build(),
new AuthUI.IdpConfig.EmailBuilder().build(),
new AuthUI.IdpConfig.PhoneBuilder().build(),
new AuthUI.IdpConfig.AnonymousBuilder().build()))
Expand Down
5 changes: 4 additions & 1 deletion auth/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
buildTypes {
named("release").configure {
isMinifyEnabled = false
consumerProguardFiles("proguard-rules.pro")
consumerProguardFiles("auth-proguard.pro")
}
}

Expand All @@ -13,6 +13,9 @@ android {
disable("UnknownNullness") // TODO fix in future PR
disable("TypographyQuotes") // Straight versus directional quotes
disable("DuplicateStrings")
disable("LocaleFolder")
disable("IconLocation")
disable("VectorPath")
}

testOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,24 @@ public AuthMethodPickerLayout.Builder setAnonymousButtonId(@IdRes int anonymousB
return this;
}

public AuthMethodPickerLayout.Builder setMicrosoftButtonId(
@IdRes int microsoftButtonId) {
providersMapping.put(AuthUI.MICROSOFT_PROVIDER, microsoftButtonId);
return this;
}

public AuthMethodPickerLayout.Builder setAppleButtonId(
@IdRes int appleButtonId) {
providersMapping.put(AuthUI.APPLE_PROVIDER, appleButtonId);
return this;
}

public AuthMethodPickerLayout.Builder setYahooButtonId(
@IdRes int yahooButtonId) {
providersMapping.put(AuthUI.YAHOO_PROVIDER, yahooButtonId);
return this;
}

/**
* Set the ID of a TextView where terms of service and privacy policy should be
* displayed.
Expand All @@ -173,7 +191,8 @@ public AuthMethodPickerLayout build() {
}

for (String key : providersMapping.keySet()) {
if (!AuthUI.SUPPORTED_PROVIDERS.contains(key)) {
if (!AuthUI.SUPPORTED_PROVIDERS.contains(key)
&& !AuthUI.SUPPORTED_OAUTH_PROVIDERS.contains(key)) {
throw new IllegalArgumentException("Unknown provider: " + key);
}
}
Expand Down
Loading

0 comments on commit d78e72b

Please sign in to comment.