PushwooshFcmRouterService
FCM service base class for apps that need their own push routing next to Pushwoosh.
Extend this class instead of FirebaseMessagingService and register your subclass in the manifest as the FCM service. Forwarding to Pushwoosh is built in and cannot be bypassed: both callbacks and the FCM dispatcher handleIntent are final.
Message dispatch is exclusive. A Pushwoosh message goes to the Pushwoosh SDK and never reaches onAppMessageReceived; any other message goes to onAppMessageReceived only. To observe Pushwoosh pushes as they arrive, override NotificationServiceExtension#onMessageReceived(PushMessage): it fires for every Pushwoosh push whichever FCM service received it, and its return value decides whether the notification is shown. To route Pushwoosh pushes to screens, handle the open, not the receive: use NotificationServiceExtension and the notification open handler chain.
Contract:
- on a new token the Pushwoosh SDK is notified first, then onAppTokenRefresh;
- both callbacks run on the FCM background executor, like the native
onMessageReceivedandonNewToken; - an exception thrown by the Pushwoosh SDK on a Pushwoosh message is logged and swallowed; an exception inside onAppMessageReceived is the app's own.
<service android:name=".YourRouterService" android:exported="false">
<intent-filter android:priority="1">
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
onDeletedMessages, onMessageSent, onSendError) are not sealed — override them as usual.