I have a login activity calling
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setIsSmartLockEnabled(!BuildConfig.DEBUG)
.setTheme(R.style.AuthUITheme)
.setLogo(R.drawable.logo_hi_res)
.setAvailableProviders(
Arrays.asList(
new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build(),
new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build(),
new AuthUI.IdpConfig.Builder(AuthUI.PHONE_VERIFICATION_PROVIDER).build()))
.build(),
RC_SIGN_IN);
but none of the providers trigger @Override protected void onActivityResult(int requestCode, int resultCode, Intent data)..
Instead the activity simply acts as if it is recreated and goes through onCreate -> onStart after signing in from any of the providers
implementation("com.firebaseui:firebase-ui-auth:3.0.0") {
exclude module: 'support-v4'
}
Any help here?
Do you have code that kills the activity in onCreate if the user is signed in? And are you calling super.onActivityResult(...) in your activities and fragments?
@dcalano I just had a revelation: are you finishing your activity in on[Create/Start] if the user is logged in? If so, check out https://github.com/firebase/FirebaseUI-Android/pull/1010#discussion_r151575726 which I still need to find a solution to.
@samtstern There hasn't been a response here in a while so we can probably close this issue.
Thanks for the reminder.
Having this problem on v4.1.0. I've got a bunch of logs in onActivityResult that aren't being printed.
Additionally, whenever I press back from the Auth activity, a UserCancellationException gets thrown and I'm not sure what I should be doing there.
I'm having the same issue on the emulator with Android Pie. onActivityResult is not called for "cancel" case. Though the same code works fine on my real device which has Android Oreo.
I was having this issue because I had set no history for the activity calling the firebase ui in the manifest file. Removing android:noHistory="true" from the activity inside manifest solved the problem
I was having this issue because I had set no history for the activity calling the firebase ui in the manifest file. Removing
android:noHistory="true"from the activity inside manifest solved the problem
haha oh wow!!! That's VERY subtle. I copied the example code into an existing project in the splash screen (which had noHistory set). I removed the noHistory and it worked! Thanks a bunch.
Just a side note: I think this should be mentioned somewhere in the documentation and/or tutorials because it's very likely to drop this into an existing app not realizing this requirement. I would have never thought to suspect that until I read your comment.
@itrevex thanks!
@nhoefer2 if you want to send a PR with a proposed doc update I'd be happy to merge it!
Most helpful comment
Having this problem on v4.1.0. I've got a bunch of logs in onActivityResult that aren't being printed.
Additionally, whenever I press back from the Auth activity, a UserCancellationException gets thrown and I'm not sure what I should be doing there.