feat: add androidPushFallback option to the Expo plugin#459
Open
priemskiyyy wants to merge 1 commit into
Open
Conversation
When expo-notifications is installed, the generated IntercomFirebaseMessagingService forwards every non-Intercom FCM message to expo-notifications for display. Apps that use another push provider (e.g. OneSignal) get each push displayed twice, because such providers receive pushes through a broadcast receiver, so the existing FCM-service detection never triggers for them. androidPushFallback lets apps choose what the generated service does with non-Intercom messages: 'expo-notifications' (forward, current behavior) or 'none' (ignore). Absent, behavior is unchanged.
priemskiyyy
force-pushed
the
feat/android-push-fallback
branch
from
July 17, 2026 09:15
a5e6262 to
33151dd
Compare
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
The Expo plugin generates an
IntercomFirebaseMessagingServicethat extends expo-notifications' messaging service wheneverexpo-notificationsis installed, forwarding every non-Intercom FCM message to expo-notifications for display.Apps that use another push provider (e.g. OneSignal, Braze) get each push displayed twice: once by the provider and once by expo-notifications (a title-only copy on the "Miscellaneous" channel). The README's existing advice (list this plugin before the other SDK) cannot help here, because providers like OneSignal receive pushes through a broadcast receiver, not a
FirebaseMessagingService, so the detection never triggers.Solution
A new optional plugin prop:
{ "androidPushFallback": "none" }"expo-notifications": forward non-Intercom messages to expo-notifications (current behavior)"none": the generated service handles Intercom pushes only and ignores everything elseInvalid values throw a clear plugin error at prebuild. Docs updated (README and JSDoc).
Testing
'none'wins over auto-detection, explicit'expo-notifications'wins when detection fails, invalid values throw (includingObject.prototypekeys like"toString", which a plainincheck would let through)yarn test,yarn typescript,yarn lintall pass"none", the duplicate lock-screen notification is gone and Intercom pushes still work