fix(android): remove PushInterceptReceiver to prevent duplicate push notifications #623
Open
akifarhan wants to merge 2 commits intodeepak786:masterfrom
Open
fix(android): remove PushInterceptReceiver to prevent duplicate push notifications #623akifarhan wants to merge 2 commits intodeepak786:masterfrom
akifarhan wants to merge 2 commits intodeepak786:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Android devices that still trigger the legacy
com.google.android.c2dm.intent.RECEIVEbroadcast (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:
io.maido.intercom.PushInterceptReceiverintercom_flutterplugin manifestcom.google.android.c2dm.intent.RECEIVE(legacy C2DM broadcast)io.intercom.android.sdk.fcm.IntercomFcmMessengerServiceintercom-sdk-fcmAAR (transitive dep ofintercom-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.IntercomFcmMessengerServiceis included automatically as a transitive dependency wheneverintercom-sdkis used — meaning both handlers are always present wheninitSdk()is called in the Application class per the recommended setup.Fix
Remove
PushInterceptReceiverfrom the plugin'sAndroidManifest.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 wheninitSdk()is called in the Application class.Removed from
android/src/main/AndroidManifest.xml:PushInterceptReceiver.ktcan also be removed entirely as it becomes unreachable.Testing
Tested on an affected device (OEM build still triggering the C2DM broadcast):