Skip to content

Add way to differentiate between "canceled by user" and "canceled by system" #1981

Open
@edenman

Description

@edenman

Steps to reproduce:

  1. I have one activity in my app, MainActivity, it has android:launchMode="singleTask"
  2. When MainActivity launches, if you are not logged in, I do startActivityForResult(AuthUI.getInstance().createSignInIntentBuilder().etc
  3. In onActivityResult I check the result code, if it's not RESULT_OK I look for an error with IdpResponse.fromResultIntent(data) and if there isn't one, I consider this a "canceled" result and I call MainActivity.finish()
  4. I'm adding deep link handling to MainActivity with a intent-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 like MainActivity->com.firebase.ui.auth.KickoffActivity. Because of singleTask, the KickoffActivity gets finished and it returns a RESULT_CANCELED with no IdpResponse. Unfortunately, this means we call finish() 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions