Skip to content

Unable to intercept back button when Intercom Messenger is displayed (Android) #591

@DaviDecoder

Description

@DaviDecoder

Problem
When Intercom Messenger is displayed via Intercom.instance.displayMessenger(), pressing the Android back button navigates within Intercom's UI (e.g., conversation → inbox) instead of closing Intercom and returning to the app. Users must press back multiple times to exit Intercom.

Desired behavior: Single back button press should close Intercom Messenger and return to the app.

Environment

  • Package: intercom_flutter version 9.4.21
  • Platform: Android

Technical Details

Intercom's SDK creates IntercomRootActivity when displaying the messenger. When this Activity is on top:

  1. Flutter widgets are not in the foreground, so PopScope/WillPopScope cannot intercept back button

  2. Our MainActivity.onBackPressed() is not called because Android routes back presses to the topmost Activity (IntercomRootActivity)

  3. We cannot override IntercomRootActivity's back button handling since it's part of the SDK

  4. Is there a way to customize back button behavior when Intercom Messenger is displayed?
    32 Could this be added as a feature (e.g., configuration option to close messenger on back press)?

Additional Context
This affects user experience in our eSIM management app. Users expect a single back press to exit Intercom and return to their dashboard, but currently must press back multiple times.

Related

  • This appears to be an architectural limitation of how Intercom's SDK manages Activities on Android
  • Similar issue may exist on iOS (not tested)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions