Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

fix: launchMode issue while using deeplinks on Android #296

@renancaraujo

Description

@renancaraujo

Originally by @gonzalogauto

Description
After adding support for deep links in my app following the official docs without doing any changes to the AndroidManifest.xml file on Android, seems that the default behaviour on some devices is open a new instance of the app even if the app is already running. Seems that the issue is caused by android:launchMode flag in the AndroidManifest.xml file, which in the very_good_core template defaults to singleTop. After searching about this issue I found that most people recommend to change that to singleTask. This solved the issue but seems that is not recommended by the android team here. IDK if this is something that needs to be solved first in the Flutter repo or not but seems to be something important to keep an eye on.
Just for now I'm using launchMode:singleTask, with singleTop or standard the problem appears again.

Steps To Reproduce

  1. Setup deeplinks on Android using the official docs mentioned before.
  2. Open a deeplink an that should open a second instance of the app.

Expected Behavior
Open a deeplink should not open a second instance of the app on Android devices.

Screenshots

  • In this video you will see that tapping on a link opens a third instance of the app because we already had a second instance open (sorry I don't have it in the video).

Additional Context
Related issues reported here:

Please LMK if you need more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions