Skip to content

feat: add androidPushFallback option to the Expo plugin#459

Open
priemskiyyy wants to merge 1 commit into
intercom:mainfrom
priemskiyyy:feat/android-push-fallback
Open

feat: add androidPushFallback option to the Expo plugin#459
priemskiyyy wants to merge 1 commit into
intercom:mainfrom
priemskiyyy:feat/android-push-fallback

Conversation

@priemskiyyy

@priemskiyyy priemskiyyy commented Jul 17, 2026

Copy link
Copy Markdown

Problem

The Expo plugin generates an IntercomFirebaseMessagingService that extends expo-notifications' messaging service whenever expo-notifications is 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 else
  • Absent: unchanged auto-detection, existing setups are unaffected

Invalid values throw a clear plugin error at prebuild. Docs updated (README and JSDoc).

Testing

  • New tests: 'none' wins over auto-detection, explicit 'expo-notifications' wins when detection fails, invalid values throw (including Object.prototype keys like "toString", which a plain in check would let through)
  • yarn test, yarn typescript, yarn lint all pass
  • Verified on a production Expo app using OneSignal: with "none", the duplicate lock-screen notification is gone and Intercom pushes still work

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
priemskiyyy force-pushed the feat/android-push-fallback branch from a5e6262 to 33151dd Compare July 17, 2026 09:15
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