Open
Description
Steps to reproduce:
- I have one activity in my app,
MainActivity
, it hasandroid:launchMode="singleTask"
- When
MainActivity
launches, if you are not logged in, I dostartActivityForResult(AuthUI.getInstance().createSignInIntentBuilder().etc
- In
onActivityResult
I check the result code, if it's notRESULT_OK
I look for an error withIdpResponse.fromResultIntent(data)
and if there isn't one, I consider this a "canceled" result and I callMainActivity.finish()
- I'm adding deep link handling to
MainActivity
with aintent-filter
tag in the manifest, but this is problematic if the user clicks on a link when they are not logged in. The stack looks likeMainActivity->com.firebase.ui.auth.KickoffActivity
. Because ofsingleTask
, theKickoffActivity
gets finished and it returns aRESULT_CANCELED
with noIdpResponse
. Unfortunately, this means we callfinish()
and
Suggested Fix
Ideally there would be a way to differentiate between "canceled by user" and "canceled by the system as a result of singleTask
"
Or if you have suggestions on how I should structure this, I'm all ears.