onActivityResult not called when using "sign in with email"
- Android device: LGE-LM-X430
- Android OS version:10
- Google Play Services version: 1.8.1
- Firebase/Play Services SDK version: 4.3.10
- FirebaseUI version: 33.1.0
Step 3: Describe the problem:
onActivityResult not called when using "sign in with email" i.e. when using an email link to sign-in. The application is supposed to save the users email during this flow and it would seem a result should be returned to the activity so it can be handled.
Steps to reproduce:
- Start a Firebase UI Activity
startForResult.launch(Intent(context, FirebaseUIActivity::class.java)) - Add an Email Provide
AuthUI.IdpConfig.EmailBuilder() .enableEmailLinkSignIn() .setActionCodeSettings(actionCodeSettings) .build(), - When the user has gone through the flow to save the users email so that it can be used when the user clicks on the link the onActivityResult is not called so that the users email can be saved somewhere
Observed Results:
onActivityResult no called
Expected Results:
- onActivityResult should be called after "Sign-in email sent"
Relevant Code:
ublic class FirebaseUIActivity : AppCompatActivity() {
// [START auth_fui_create_launcher]
// See: https://developer.android.com/training/basics/intents/result
private val signInLauncher = registerForActivityResult(
FirebaseAuthUIActivityResultContract()
) { res ->
var idToken : String? = null
this.onSignInResult(res)
}}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
}
Potentially this can really only be solved by updating the FirebaseUI Library
In auth/src/main/java/com/firebase/ui/auth/ui/email/EmailLinkFragment.java (https://github.com/firebase/FirebaseUI-Android)
it would be good to add a line to save the email to SharePreferences in
@Override
protected void onSuccess(@NonNull String email) {
Log.w(TAG, "Email for email link sign in sent successfully.");
//*. SAVE email TO SHARED PREFERENCES *//
doAfterTimeout(() -> mTopLevelView.setVisibility(View.VISIBLE));
mEmailSent = true;
}
or alternatively if someone knows how to intercept this email during the passwordless email link flow it would be great to provide an example
Hello,
Thank you for taking the time to submit this bug.
A new release is planned shortly, which should resolve this request.
In the meantime, we will close this issue, if this is not resolved in the new version - please feel free to create a new issue for this bug.