Conversation
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.
Description
Android delivers each FCM message to exactly one
MESSAGING_EVENTservice per app, soour VoIP
PushNotificationServiceused to swallow every push — apps also usingexpo-notifications or
@react-native-firebase/messagingsilently lost all theirnotifications and token callbacks (repro'd on baseline: builds clean, expo receives
nothing).
This PR makes the two coexist:
fishjam: "voip-incoming"(namespaced key, typed value so future kinds like a cancelpush fit the same key). The example server now sends it.
onNewToken+onRegistered),and
onDeletedMessagesare handed to the app's other messaging service, configured viaVoipFallbackMessagingServicemanifest meta-data. The fallback class is instantiatedreflectively (
attachBaseContextinjected, same pattern Braze uses in production), soits real native code runs — killed-state behavior preserved, no JS required.
android.voipFallbackMessagingServiceoption(
"expo-notifications","@react-native-firebase/messaging", or a class name):writes the meta-data, strips the library's own service with
tools:node="remove",and gives ours
android:priority="1". Newandroid.voipMessagingService: falseopt-out for apps bringing their own dispatcher.
PushNotificationService.handleVoipMessage(context, message): Boolean/handleNewToken(token)for apps that own their messaging service.Motivation and Context
A host app cannot currently use any other push-notification library alongside Fishjam
VoIP on Android: our service claims the single FCM slot and drops everything that isn't a
call — with no error anywhere (the manifest merges fine; expo-notifications even ships its
service at priority −1, so ours always wins and theirs is dead code). This is a hard
blocker for real apps, which virtually always have non-VoIP notifications.
Documentation impact
(README §9.6 "Coexisting with other push-notification libraries" — setup, wire format,
bare-RN recipe, dispatcher example — is included in this PR.)
Types of changes
not work as expected)
✅ Runtime-tested (Pixel 9 emulator, real FCM v1 sends, expo-notifications 0.32.17 as fallback)
dumpsys: our service soleMESSAGING_EVENThandler, expo's removedonNewToken(its token listeners keep working)pidofempty) → native relay, expo shows notificationfishjam: "voip-incoming") rings in fg / bg / killedroomNamebut no/wrongfishjamkey → relayed, no phantom call