Skip to content

feat: register Android push service in manifest and wire into plugin#384

Merged
Rosie-Kennelly-1 merged 3 commits intomainfrom
rosie/android-expo-push-manifest
Mar 10, 2026
Merged

feat: register Android push service in manifest and wire into plugin#384
Rosie-Kennelly-1 merged 3 commits intomainfrom
rosie/android-expo-push-manifest

Conversation

@Rosie-Kennelly-1
Copy link
Contributor

@Rosie-Kennelly-1 Rosie-Kennelly-1 commented Mar 6, 2026

Why?

towards: https://github.com/intercom/intercom/issues/360467

The generated FirebaseMessagingService from the previous PR needs to be registered in AndroidManifest.xml for Android to route FCM events to it, and wired into the existing Expo push notification plugin pipeline.

How?

Adds manifest registration with android:priority="10" and android:exported="false", detects existing FCM services to avoid conflicts, and chains the Android plugin into withPushNotifications.ts alongside the existing iOS plugins.

Part 2 of 2. Stacked on:

Related:

Known limitation: FCM conflict detection is plugin-order dependent

The conflict detection (which skips Intercom's service registration when another FirebaseMessagingService is found) only works when the conflicting plugin is listed after @intercom/intercom-react-native in the Expo plugins array.

This is a constraint of Expo's withAndroidManifest mod system, which executes callbacks in LIFO order — mods from plugins listed earlier in the array run later, so they aren't visible to Intercom's conflict check. Alternative approaches (withDangerousMod post-processing) were investigated but Expo doesn't invoke dangerous mod callbacks reliably for this use case.

Impact: If another SDK's plugin is listed before Intercom and registers a MESSAGING_EVENT service, both services end up in the manifest. Intercom's priority="10" means it receives all FCM messages, and non-Intercom pushes to the other SDK are silently dropped via the no-op super.onMessageReceived().

Mitigation: Users with other FCM-handling SDKs should list @intercom/intercom-react-native first in their plugins array. This is documented in a JSDoc comment on registerServiceInManifest.

Generated with Claude Code

Rosie-Kennelly-1 and others added 3 commits March 10, 2026 14:39
…nto plugin pipeline

Adds manifest registration for the generated service with priority 10
and android:exported=false. Detects existing FCM services and warns
instead of conflicting. Wires the Android plugin into the push
notification pipeline alongside the existing iOS plugins.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The conflict detection in registerServiceInManifest only works when the
competing plugin is listed after Intercom in the Expo plugins array, due
to Expo's LIFO mod execution order. Added a JSDoc comment explaining
this constraint and advising users to list Intercom first.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Rosie-Kennelly-1 Rosie-Kennelly-1 force-pushed the rosie/android-expo-push-manifest branch from 4e4f18b to 487d4d0 Compare March 10, 2026 14:39
@Rosie-Kennelly-1 Rosie-Kennelly-1 merged commit 79bec30 into main Mar 10, 2026
8 checks passed
@Rosie-Kennelly-1 Rosie-Kennelly-1 deleted the rosie/android-expo-push-manifest branch March 10, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants