intercom_flutter icon indicating copy to clipboard operation
intercom_flutter copied to clipboard

Intercom Push Notification Handling Not Triggering in Flutter App

Open amalshyjo opened this issue 1 year ago • 1 comments

Description

In our Flutter application, we are encountering an issue where the Intercom.instance.handlePush(notification); function does not trigger any action upon receiving a push notification when the app is in the foreground. This functionality is crucial for our app's support feature, which is supposed to show a snackbar notification and, upon tapping, display the Intercom message. However, despite the snackbar showing up and being tappable, the expected Intercom message window does not appear.

Environment

  • Intercom Flutter Version: intercom_flutter: ^7.6.9
  • Flutter Version: Flutter 3.7.8, Channel stable, on macOS 14.2.1 23C71 darwin-arm64
  • Android SDK: Version 32.1.0-rc1
  • Xcode Version: 15.2
  • Flutter Doctor Output:
    • [✓] Android toolchain - develop for Android devices
    • [✓] Xcode - develop for iOS and macOS
    • [✓] Chrome - develop for the web
    • [✓] Android Studio (version 2023.1)
    • [✓] VS Code (version 1.86.1)
    • [✓] Connected device (7 available)
    • [✓] HTTP Host Availability

Please note that updating to the latest version of the Intercom Flutter plugin is not an option for us at this moment due to multiple package conflicts.

Steps to Reproduce

  1. Listen for Firebase push notifications in the app.
  2. Check if the incoming notification is an Intercom push notification.
  3. Show a snackbar notification when an Intercom push notification is received.
  4. On tapping the snackbar, attempt to trigger Intercom.instance.handlePush(notification); to display the Intercom message.

Expected Behavior

Upon tapping the snackbar that appears when an Intercom push notification is received, the Intercom chat window should open, displaying the message.

Actual Behavior

The snackbar appears and is interactive, but tapping on it does not open the Intercom chat window. No errors are logged in the console, and it seems like the Intercom.instance.handlePush(notification); call does not trigger any action.

Directly calling Intercom.instance.displayMessages(); works as expected, indicating that the Intercom setup is functional properly.

Relevant Code

if (isIntercomPush) {
  showSupportNotification(
    context: GlobalVariable.navState.currentContext!,
    notification: message.data,
  );
}

 Flash(
        controller: controller,
        onTap: (() async {
          controller.dismiss();
          await Intercom.instance.handlePush(notification);
        }),
...
)

Usage Context

The issue occurs when handling Firebase push notifications intended for Intercom. The expected behavior is to show the Intercom message upon user interaction with the notification.

amalshyjo avatar Feb 14 '24 10:02 amalshyjo

@amalshyjo Not sure what could be the issue. Can you provide the working sample with this issue then probably I will be able to check?

deepak786 avatar Feb 20 '24 18:02 deepak786