Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intercom Push Notification Handling Not Triggering in Flutter App #405

Open
amalshyjo opened this issue Feb 14, 2024 · 1 comment
Open
Labels
feature-notifications Related to push notifications platform-android Specific to Android platform support Asking for help writing an application

Comments

@amalshyjo
Copy link

amalshyjo commented Feb 14, 2024

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.

@deepak786
Copy link
Collaborator

@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 deepak786 added platform-android Specific to Android platform feature-notifications Related to push notifications support Asking for help writing an application labels Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-notifications Related to push notifications platform-android Specific to Android platform support Asking for help writing an application
Projects
None yet
Development

No branches or pull requests

2 participants