Skip to content

Commit

Permalink
Merge pull request #1122 from firebase/version-3.2.1-release
Browse files Browse the repository at this point in the history
Version 3.2.1
  • Loading branch information
samtstern authored Jan 23, 2018
2 parents 83e6a76 + d248eee commit 63572c5
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 18 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ libraries.
```groovy
dependencies {
// FirebaseUI for Firebase Realtime Database
implementation 'com.firebaseui:firebase-ui-database:3.2.0'
implementation 'com.firebaseui:firebase-ui-database:3.2.1'
// FirebaseUI for Cloud Firestore
implementation 'com.firebaseui:firebase-ui-firestore:3.2.0'
implementation 'com.firebaseui:firebase-ui-firestore:3.2.1'
// FirebaseUI for Firebase Auth
implementation 'com.firebaseui:firebase-ui-auth:3.2.0'
implementation 'com.firebaseui:firebase-ui-auth:3.2.1'
// FirebaseUI for Cloud Storage
implementation 'com.firebaseui:firebase-ui-storage:3.2.0'
implementation 'com.firebaseui:firebase-ui-storage:3.2.1'
}
```

Expand Down Expand Up @@ -102,7 +102,7 @@ For convenience, here are some recent examples:

| FirebaseUI Version | Firebase/Play Services Version |
|--------------------|--------------------------------|
| 3.2.0 | 11.8.0 |
| 3.2.1 | 11.8.0 |
| 3.1.3 | 11.8.0 |
| 3.1.2 | 11.6.2 |
| 3.1.0 | 11.4.2 |
Expand Down
2 changes: 1 addition & 1 deletion auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Gradle, add the dependency:
```groovy
dependencies {
// ...
implementation 'com.firebaseui:firebase-ui-auth:3.2.0'
implementation 'com.firebaseui:firebase-ui-auth:3.2.1'
// Required only if Facebook login support is required
// Find the latest Facebook SDK releases here: https://goo.gl/Ce5L94
Expand Down
2 changes: 1 addition & 1 deletion auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dependencies {
testImplementation 'com.facebook.android:facebook-login:4.29.0'
testImplementation("com.twitter.sdk.android:twitter-core:3.1.1@aar") { transitive = true }

implementation project(':internal:lintchecks')
debugImplementation project(':internal:lintchecks')
}

javadoc.include([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.google.android.gms.auth.api.credentials.CredentialRequestResponse;
import com.google.android.gms.auth.api.credentials.CredentialsClient;
import com.google.android.gms.auth.api.credentials.IdentityProviders;
import com.google.android.gms.common.api.CommonStatusCodes;
import com.google.android.gms.common.api.ResolvableApiException;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
Expand Down Expand Up @@ -93,14 +94,26 @@ public void onCreate(Bundle savedInstance) {
}

FlowParameters flowParams = getFlowParams();
if (flowParams.enableCredentials) {

// Only support password credentials if email auth is enabled
boolean supportPasswords = false;
for (AuthUI.IdpConfig config : flowParams.providerInfo) {
if (EmailAuthProvider.PROVIDER_ID.equals(config.getProviderId())) {
supportPasswords = true;
}
}
List<String> accountTypes = getSupportedAccountTypes();

// If the request will be empty, avoid the step entirely
boolean willRequestCredentials = supportPasswords || accountTypes.size() > 0;

if (flowParams.enableCredentials && willRequestCredentials) {
getDialogHolder().showLoadingDialog(R.string.fui_progress_dialog_loading);

mCredentialsClient = GoogleApiUtils.getCredentialsClient(getActivity());

mCredentialsClient.request(new CredentialRequest.Builder()
.setPasswordLoginSupported(true)
.setAccountTypes(getSupportedAccountTypes().toArray(new String[0]))
.setPasswordLoginSupported(supportPasswords)
.setAccountTypes(accountTypes.toArray(new String[accountTypes.size()]))
.build())
.addOnCompleteListener(this);
} else {
Expand All @@ -109,7 +122,7 @@ public void onCreate(Bundle savedInstance) {
}

@Override
public void onSaveInstanceState(Bundle outState) {
public void onSaveInstanceState(@NonNull Bundle outState) {
// It doesn't matter what we put here, we just don't want outState to be empty
outState.putBoolean(ExtraConstants.HAS_EXISTING_INSTANCE, true);
super.onSaveInstanceState(outState);
Expand All @@ -122,19 +135,19 @@ public void onComplete(@NonNull Task<CredentialRequestResponse> task) {
// Auto sign-in success
handleCredential(task.getResult().getCredential());
return;
} else {
if (task.getException() instanceof ResolvableApiException) {
ResolvableApiException rae = (ResolvableApiException) task.getException();
} else if (task.getException() instanceof ResolvableApiException) {
ResolvableApiException rae = (ResolvableApiException) task.getException();
if (rae.getStatusCode() == CommonStatusCodes.RESOLUTION_REQUIRED) {
try {
startIntentSenderForResult(rae.getResolution().getIntentSender(),
RC_CREDENTIALS_READ);
return;
} catch (IntentSender.SendIntentException e) {
Log.e(TAG, "Failed to send Credentials intent.", e);
}
} else {
Log.e(TAG, "Non-resolvable exception:\n" + task.getException());
}
} else {
Log.e(TAG, "Non-resolvable exception:\n" + task.getException());
}
startAuthMethodChoice();
}
Expand Down
2 changes: 1 addition & 1 deletion constants.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project.ext {
submodules = ['database', 'auth', 'storage', 'firestore', 'common']
group = 'com.firebaseui'
version = '3.2.0'
version = '3.2.1'
pomdesc = 'Firebase UI Android'

compileSdk = 27
Expand Down

0 comments on commit 63572c5

Please sign in to comment.