Skip to content

Reopens Android app from recents trigger deeplink again #1335

@Korpyc

Description

@Korpyc

Describe the bug

Hi, there, I’m facing an issue where opening the Flutter app via a deeplink triggers the expected handling, but when I hide the app and return to it from recent apps, FlutterBranchSdk.listSession() emits the same deeplink again.

This occurs only with non-Branch links in the format:
scheme://some_link

How can I prevent the deeplink from being re-emitted when the app is resumed from recents?

originally created tread here

Steps to reproduce

Open the app using a non-Branch deeplink, in format:
scheme://some_link

Observe that the deeplink is handled correctly on app start.

Hide app to background the app (do not swipe it away).

Reopen the app from the recent apps screen.

Observe that FlutterBranchSdk.listSession() emits the same deeplink again, even though the app was not reopened via a deeplink.

Expected behavior

I expect to see generic state:

BranchReferralInitListener - params: {"+clicked_branch_link":false,"+is_first_session":false}

SDK Version

5.20.+

Make and Model

Oneplus 13

OS

16

Additional Information/Context

log from SDK:

2025-12-24 18:51:04.924  5271-5271  FlutterBranchSDK        com.example.app                   D  SDK Init
2025-12-24 18:51:04.924  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onAttachedToActivity
2025-12-24 18:51:04.924  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered setActivity
2025-12-24 18:51:04.948  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onActivityStarted: com.example.app.MainActivity
2025-12-24 18:51:04.948  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered SessionBuilder init
2025-12-24 18:51:04.953  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onActivityResumed: com.example.app.MainActivity
2025-12-24 18:51:07.383  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered setupBranch
2025-12-24 18:51:07.383  5271-5271  FlutterBranchSDK        com.example.app                   D  notifyNativeToInit()
2025-12-24 18:51:07.396  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onListen
2025-12-24 18:51:07.426  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onAttachedToEngine
2025-12-24 18:51:07.426  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered setupChannels
2025-12-24 18:51:07.426  5271-5271  FlutterBranchSDK        com.example.app                   D  SDK Init
2025-12-24 18:51:07.713  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onInitFinished
2025-12-24 18:51:07.713  5271-5271  FlutterBranchSDK        com.example.app                   D  BranchReferralInitListener - params: {"+clicked_branch_link":false,"+is_first_session":false}
2025-12-24 18:51:28.968  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onActivityPaused: com.example.app.MainActivity
2025-12-24 18:51:28.981  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onActivityStopped: com.example.app.MainActivity
2025-12-24 18:51:30.354  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onActivityStarted: com.example.app.MainActivity
2025-12-24 18:51:30.354  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered SessionBuilder init
2025-12-24 18:51:30.359  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onNewIntent
2025-12-24 18:51:30.367  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onActivityResumed: com.example.app.MainActivity
2025-12-24 18:51:30.577  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onInitFinished
2025-12-24 18:51:30.577  5271-5271  FlutterBranchSDK        com.example.app                   D  BranchReferralInitListener - params: {"+non_branch_link":"customsheme:\/\/menu\/settings_referrals","+clicked_branch_link":false,"+is_first_session":false}
2025-12-24 18:51:40.765  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onActivityPaused: com.example.app.MainActivity
2025-12-24 18:51:40.773  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onActivityStopped: com.example.app.MainActivity
2025-12-24 18:51:44.805  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onActivityStarted: com.example.app.MainActivity
2025-12-24 18:51:44.805  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered SessionBuilder init
2025-12-24 18:51:44.815  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onActivityResumed: com.example.app.MainActivity
2025-12-24 18:51:45.023  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onInitFinished
2025-12-24 18:51:45.023  5271-5271  FlutterBranchSDK        com.example.app                   D  BranchReferralInitListener - params: {"+non_branch_link":"customsheme:\/\/menu\/settings_referrals","+clicked_branch_link":false,"+is_first_session":false}
2025-12-24 18:51:50.428  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onActivityPaused: com.example.app.MainActivity
2025-12-24 18:51:50.441  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onActivityStopped: com.example.app.MainActivity
2025-12-24 18:51:53.352  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onActivityStarted: com.example.app.MainActivity
2025-12-24 18:51:53.352  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered SessionBuilder init
2025-12-24 18:51:53.369  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onActivityResumed: com.example.app.MainActivity
2025-12-24 18:51:53.579  5271-5271  FlutterBranchSDK        com.example.app                   D  triggered onInitFinished
2025-12-24 18:51:53.579  5271-5271  FlutterBranchSDK        com.example.app                   D  BranchReferralInitListener - params: {"+non_branch_link":"customsheme:\/\/menu\/settings_referrals","+clicked_branch_link":false,"+is_first_session":false}

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