Skip to content

fix(android): remove PushInterceptReceiver to prevent duplicate push notifications #623

Open
akifarhan wants to merge 2 commits intodeepak786:masterfrom
akifarhan:fix-duplicate-notification
Open

fix(android): remove PushInterceptReceiver to prevent duplicate push notifications #623
akifarhan wants to merge 2 commits intodeepak786:masterfrom
akifarhan:fix-duplicate-notification

Conversation

@akifarhan
Copy link
Copy Markdown

Problem

On Android devices that still trigger the legacy com.google.android.c2dm.intent.RECEIVE broadcast (older Android versions and certain OEM builds), Intercom push notifications are displayed twice.

Root Cause

The merged Android manifest ends up with two simultaneous Intercom push handlers:

Handler Registered by Trigger
io.maido.intercom.PushInterceptReceiver intercom_flutter plugin manifest com.google.android.c2dm.intent.RECEIVE (legacy C2DM broadcast)
io.intercom.android.sdk.fcm.IntercomFcmMessengerService intercom-sdk-fcm AAR (transitive dep of intercom-sdk) com.google.firebase.MESSAGING_EVENT (modern Firebase path)

On affected devices, both handlers receive the same push payload and independently call handlePush(), resulting in two notifications being displayed.

IntercomFcmMessengerService is included automatically as a transitive dependency whenever intercom-sdk is used — meaning both handlers are always present when initSdk() is called in the Application class per the recommended setup.

Fix

Remove PushInterceptReceiver from the plugin's AndroidManifest.xml. IntercomFcmMessengerService (registered by the native SDK's own AAR) is the intended modern handler and covers all cases including background and killed-state delivery when initSdk() is called in the Application class.

Removed from android/src/main/AndroidManifest.xml:

<receiver
    android:name="io.maido.intercom.PushInterceptReceiver"
    android:exported="true"
    android:permission="com.google.android.c2dm.permission.SEND">
    <intent-filter>
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
    </intent-filter>
</receiver>

PushInterceptReceiver.kt can also be removed entirely as it becomes unreachable.

Testing

Tested on an affected device (OEM build still triggering the C2DM broadcast):

  • Before fix: every Intercom push notification displayed twice
  • After fix: single notification displayed correctly
  • Background and killed-state push delivery unaffected

akif added 2 commits April 10, 2026 19:15
Add tools:node="remove" to PushInterceptReceiver in the plugin manifest so Android manifest merger strips the legacy GCM/C2DM broadcast receiver. Modern Intercom SDK handles pushes via IntercomFcmMessengerService (FCM), so having both active causes duplicate notifications.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant