Skip to content

Commit d78e72b

Browse files
authored
Version 6.1.0
Version 6.1.0
2 parents 3fab6d5 + 81655ff commit d78e72b

File tree

147 files changed

+2395
-245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+2395
-245
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ libraries.
4848
```groovy
4949
dependencies {
5050
// FirebaseUI for Firebase Realtime Database
51-
implementation 'com.firebaseui:firebase-ui-database:6.0.2'
51+
implementation 'com.firebaseui:firebase-ui-database:6.1.0'
5252
5353
// FirebaseUI for Cloud Firestore
54-
implementation 'com.firebaseui:firebase-ui-firestore:6.0.2'
54+
implementation 'com.firebaseui:firebase-ui-firestore:6.1.0'
5555
5656
// FirebaseUI for Firebase Auth
57-
implementation 'com.firebaseui:firebase-ui-auth:6.0.2'
57+
implementation 'com.firebaseui:firebase-ui-auth:6.1.0'
5858
5959
// FirebaseUI for Cloud Storage
60-
implementation 'com.firebaseui:firebase-ui-storage:6.0.2'
60+
implementation 'com.firebaseui:firebase-ui-storage:6.1.0'
6161
}
6262
```
6363

app/src/main/java/com/firebase/uidemo/auth/AuthUiActivity.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ public class AuthUiActivity extends AppCompatActivity {
7676
@BindView(R.id.email_link_provider) CheckBox mUseEmailLinkProvider;
7777
@BindView(R.id.phone_provider) CheckBox mUsePhoneProvider;
7878
@BindView(R.id.anonymous_provider) CheckBox mUseAnonymousProvider;
79+
@BindView(R.id.apple_provider) CheckBox mUseAppleProvider;
80+
@BindView(R.id.microsoft_provider) CheckBox mUseMicrosoftProvider;
81+
@BindView(R.id.yahoo_provider) CheckBox mUseYahooProvider;
7982

8083
@BindView(R.id.default_layout) RadioButton mDefaultLayout;
8184
@BindView(R.id.custom_layout) RadioButton mCustomLayout;
@@ -182,6 +185,9 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
182185
mUseEmailLinkProvider.setChecked(false);
183186
mUsePhoneProvider.setChecked(false);
184187
mUseAnonymousProvider.setChecked(false);
188+
mUseMicrosoftProvider.setChecked(false);
189+
mUseYahooProvider.setChecked(false);
190+
mUseAppleProvider.setChecked(false);
185191
}
186192
}
187193
});
@@ -421,6 +427,18 @@ private List<IdpConfig> getSelectedProviders() {
421427
selectedProviders.add(new IdpConfig.AnonymousBuilder().build());
422428
}
423429

430+
if (mUseMicrosoftProvider.isChecked()) {
431+
selectedProviders.add(new IdpConfig.MicrosoftBuilder().build());
432+
}
433+
434+
if (mUseYahooProvider.isChecked()) {
435+
selectedProviders.add(new IdpConfig.YahooBuilder().build());
436+
}
437+
438+
if (mUseAppleProvider.isChecked()) {
439+
selectedProviders.add(new IdpConfig.AppleBuilder().build());
440+
}
441+
424442
return selectedProviders;
425443
}
426444

app/src/main/java/com/firebase/uidemo/auth/SignedInActivity.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ private void populateProfile(@Nullable IdpResponse response) {
192192
// Ignore this provider, it's not very meaningful
193193
break;
194194
default:
195-
throw new IllegalStateException(
196-
"Unknown provider: " + info.getProviderId());
195+
providers.add(info.getProviderId());
197196
}
198197
}
199198
}

app/src/main/java/com/firebase/uidemo/util/ConfigurationUtils.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ public static List<AuthUI.IdpConfig> getConfiguredProviders(@NonNull Context con
6767

6868

6969
providers.add(new AuthUI.IdpConfig.PhoneBuilder().build());
70-
70+
providers.add(new AuthUI.IdpConfig.MicrosoftBuilder().build());
71+
providers.add(new AuthUI.IdpConfig.YahooBuilder().build());
72+
providers.add(new AuthUI.IdpConfig.AppleBuilder().build());
7173

7274
return providers;
7375
}

app/src/main/res/layout/auth_ui_layout.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,27 @@
102102
android:checked="true"
103103
android:text="@string/providers_anonymous" />
104104

105+
<CheckBox
106+
android:id="@+id/apple_provider"
107+
android:layout_width="wrap_content"
108+
android:layout_height="wrap_content"
109+
android:checked="true"
110+
android:text="@string/providers_apple" />
111+
112+
<CheckBox
113+
android:id="@+id/microsoft_provider"
114+
android:layout_width="wrap_content"
115+
android:layout_height="wrap_content"
116+
android:checked="true"
117+
android:text="@string/providers_microsoft" />
118+
119+
<CheckBox
120+
android:id="@+id/yahoo_provider"
121+
android:layout_width="wrap_content"
122+
android:layout_height="wrap_content"
123+
android:checked="true"
124+
android:text="@string/providers_yahoo" />
125+
105126
<TextView
106127
style="@style/Base.TextAppearance.AppCompat.Subhead"
107128
android:layout_width="wrap_content"

app/src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<string name="providers_email_link">Email link</string>
3131
<string name="providers_phone">Phone</string>
3232
<string name="providers_anonymous">Anonymous</string>
33+
<string name="providers_apple">Apple</string>
34+
<string name="providers_microsoft">Microsoft</string>
35+
<string name="providers_yahoo">Yahoo</string>
3336

3437
<string name="layout_header">Layout</string>
3538
<string name="layout_default">Default</string>

auth-github/src/main/java/com/firebase/ui/auth/data/remote/GitHubSignInHandler.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.firebase.ui.auth.util.ExtraConstants;
2121
import com.firebase.ui.auth.viewmodel.ProviderSignInBase;
2222
import com.firebase.ui.auth.viewmodel.RequestCodes;
23+
import com.google.firebase.auth.FirebaseAuth;
2324
import com.google.firebase.auth.GithubAuthProvider;
2425

2526
import java.util.ArrayList;
@@ -183,4 +184,11 @@ private interface GitHubApi {
183184
@GET("user")
184185
Call<GitHubProfile> getUser(@Header("Authorization") String token);
185186
}
187+
188+
@Override
189+
public void startSignIn(@NonNull FirebaseAuth auth,
190+
@NonNull HelperActivityBase activity,
191+
@NonNull String providerId) {
192+
startSignIn(activity);
193+
}
186194
}

auth/README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Gradle, add the dependency:
6565
```groovy
6666
dependencies {
6767
// ...
68-
implementation 'com.firebaseui:firebase-ui-auth:6.0.2'
68+
implementation 'com.firebaseui:firebase-ui-auth:6.1.0'
6969
7070
// Required only if Facebook login support is required
7171
// Find the latest Facebook SDK releases here: https://goo.gl/Ce5L94
@@ -97,8 +97,8 @@ for more information.
9797

9898
### Identity provider configuration
9999

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

103103
#### Google
104104

@@ -148,6 +148,34 @@ allprojects {
148148
}
149149
```
150150

151+
#### Microsoft, Apple, and Yahoo
152+
153+
No FirebaseUI configuration is required for these providers.
154+
155+
We support the use of scopes and custom parameters for these providers. For example:
156+
157+
```java
158+
List<String> scopes =
159+
new ArrayList<String>() {
160+
{
161+
add("mail.read");
162+
add("calendars.read");
163+
}
164+
};
165+
166+
Map<String, String> customParams = new HashMap<>();
167+
customParams.put("tenant", "TENANT_ID");
168+
169+
IdpConfig microsoftConfig = new IdpConfig.MicrosoftBuilder()
170+
.setScopes(scopes)
171+
.setCustomParameters(customParams)
172+
.build();
173+
selectedProviders.add(microsoftConfig);
174+
```
175+
176+
Note: unlike other sign-in methods, signing in with these providers involves the use of a
177+
[Custom Chrome Tab](https://developer.chrome.com/multidevice/android/customtabs).
178+
151179
#### GitHub
152180

153181
We do not currently support Github as a sign-in method in FirebaseUI on Android. The current
@@ -236,6 +264,9 @@ startActivityForResult(
236264
new AuthUI.IdpConfig.GoogleBuilder().build(),
237265
new AuthUI.IdpConfig.FacebookBuilder().build(),
238266
new AuthUI.IdpConfig.TwitterBuilder().build(),
267+
new AuthUI.IdpConfig.MicrosoftBuilder().build(),
268+
new AuthUI.IdpConfig.YahooBuilder().build(),
269+
new AuthUI.IdpConfig.AppleBuilder().build(),
239270
new AuthUI.IdpConfig.EmailBuilder().build(),
240271
new AuthUI.IdpConfig.PhoneBuilder().build(),
241272
new AuthUI.IdpConfig.AnonymousBuilder().build()))

auth/build.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ android {
44
buildTypes {
55
named("release").configure {
66
isMinifyEnabled = false
7-
consumerProguardFiles("proguard-rules.pro")
7+
consumerProguardFiles("auth-proguard.pro")
88
}
99
}
1010

@@ -13,6 +13,9 @@ android {
1313
disable("UnknownNullness") // TODO fix in future PR
1414
disable("TypographyQuotes") // Straight versus directional quotes
1515
disable("DuplicateStrings")
16+
disable("LocaleFolder")
17+
disable("IconLocation")
18+
disable("VectorPath")
1619
}
1720

1821
testOptions {

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,24 @@ public AuthMethodPickerLayout.Builder setAnonymousButtonId(@IdRes int anonymousB
158158
return this;
159159
}
160160

161+
public AuthMethodPickerLayout.Builder setMicrosoftButtonId(
162+
@IdRes int microsoftButtonId) {
163+
providersMapping.put(AuthUI.MICROSOFT_PROVIDER, microsoftButtonId);
164+
return this;
165+
}
166+
167+
public AuthMethodPickerLayout.Builder setAppleButtonId(
168+
@IdRes int appleButtonId) {
169+
providersMapping.put(AuthUI.APPLE_PROVIDER, appleButtonId);
170+
return this;
171+
}
172+
173+
public AuthMethodPickerLayout.Builder setYahooButtonId(
174+
@IdRes int yahooButtonId) {
175+
providersMapping.put(AuthUI.YAHOO_PROVIDER, yahooButtonId);
176+
return this;
177+
}
178+
161179
/**
162180
* Set the ID of a TextView where terms of service and privacy policy should be
163181
* displayed.
@@ -173,7 +191,8 @@ public AuthMethodPickerLayout build() {
173191
}
174192

175193
for (String key : providersMapping.keySet()) {
176-
if (!AuthUI.SUPPORTED_PROVIDERS.contains(key)) {
194+
if (!AuthUI.SUPPORTED_PROVIDERS.contains(key)
195+
&& !AuthUI.SUPPORTED_OAUTH_PROVIDERS.contains(key)) {
177196
throw new IllegalArgumentException("Unknown provider: " + key);
178197
}
179198
}

0 commit comments

Comments
 (0)