Skip to content

[Question]: Handling Silent Push Notifications with a Custom FCM Service While Using OneSignal #2522

Closed

Description

@parlinsqe

How can we help?

I’d like to ask about the feasibility of forwarding an FCM push notification payload to OneSignal.

In my use case, I need to implement a custom FirebaseMessagingService to handle background data processing—specifically for silent push notifications that trigger background tasks. Because of this requirement, I cannot rely solely on OneSignal’s default FCM handling.

My proposed approach is to send a high-priority FCM message to my app. When the incoming payload matches the OneSignal notification format, I would like to forward that payload to OneSignal so it can be processed and displayed as a normal OneSignal notification.

Is this approach supported or recommended, and are there any constraints or best practices I should be aware of when forwarding FCM payloads to OneSignal from a custom FCM service?

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. jinliu9508 commented on Jan 23, 2026

    @jinliu9508
    Contributor

    Hi! Thanks for reaching out and sharing your use case — that’s a great question.

    Forwarding an FCM payload from your own FirebaseMessagingService into OneSignal is not something we currently support or recommend. The OneSignal SDK is designed to receive its notifications directly so it can properly handle notification display, analytics, opens, and internal state. Intercepting those messages and attempting to pass them along can lead to issues such as duplicate notifications, missing tracking, or the SDK not recognizing the message correctly.

    The recommended approach is to let OneSignal handle user-visible notifications, and use your own FCM messages (with a distinct key or payload) for silent pushes and background processing.

    If you need a custom FirebaseMessagingService, please ensure it only processes messages intended for your app logic and allows OneSignal-formatted messages to pass through untouched so the SDK can handle them as expected.

    If you can share more details about the background work you need to perform or when the notification should be shown, we’re happy to help you find the best architecture for your scenario.

  2. parlinsqe commented on Jan 27, 2026

    @parlinsqe
    Author

    At the moment, our main requirement is to perform background work for app-specific logic that is not user-visible, and we want to ensure this is architected in a way that does not conflict with OneSignal’s handling of notifications.

    If there are best practices or examples for:

    • Structuring FCM payloads so OneSignal and app-specific messages can coexist safely, or
    • Having a custom FirebaseMessagingService alongside OneSignal, where the service only processes app-specific FCM messages and allows OneSignal-formatted messages to pass through untouched.

    we’d really appreciate your guidance.

  3. parlinsqe commented on Jan 29, 2026

    @parlinsqe
    Author

    Closing this as found related answer here: #1355

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions