Skip to content

Commit 145f789

Browse files
authored
Fix sample app and GSI error handling (#839)
Fixes #833 Change-Id: I6f22cf814625a1f4a1c14c3007cfd3491b8cd22a
1 parent 023b69d commit 145f789

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454

5555
public class SignedInActivity extends AppCompatActivity {
5656

57+
private static final String EXTRA_IDP_RESPONSE = "extra_idp_response";
5758
private static final String EXTRA_SIGNED_IN_CONFIG = "extra_signed_in_config";
5859

5960
@BindView(android.R.id.content)
@@ -83,7 +84,11 @@ public static Intent createIntent(
8384
Context context,
8485
IdpResponse idpResponse,
8586
SignedInConfig signedInConfig) {
86-
Intent startIntent = idpResponse == null ? new Intent() : idpResponse.toIntent();
87+
88+
Intent startIntent = new Intent();
89+
if (idpResponse != null) {
90+
startIntent.putExtra(EXTRA_IDP_RESPONSE, idpResponse);
91+
}
8792

8893
return startIntent.setClass(context, SignedInActivity.class)
8994
.putExtra(EXTRA_SIGNED_IN_CONFIG, signedInConfig);
@@ -100,7 +105,7 @@ public void onCreate(Bundle savedInstanceState) {
100105
return;
101106
}
102107

103-
mIdpResponse = IdpResponse.fromResultIntent(getIntent());
108+
mIdpResponse = getIntent().getParcelableExtra(EXTRA_IDP_RESPONSE);
104109
mSignedInConfig = getIntent().getParcelableExtra(EXTRA_SIGNED_IN_CONFIG);
105110

106111
setContentView(R.layout.signed_in_layout);

auth/src/main/java/com/firebase/ui/auth/provider/GoogleProvider.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ private void onError(GoogleSignInResult result) {
165165
.build();
166166
startLogin(mActivity);
167167
} else {
168+
if (status.getStatusCode() == CommonStatusCodes.DEVELOPER_ERROR) {
169+
Log.w(TAG, "Developer error: this application is misconfigured. Check your SHA1 " +
170+
" and package name in the Firebase console.");
171+
Toast.makeText(mActivity, "Developer error.", Toast.LENGTH_SHORT).show();
172+
}
168173
onError(status.getStatusCode() + " " + status.getStatusMessage());
169174
}
170175
}

0 commit comments

Comments
 (0)