Skip to content

[question]: Can we trigger Dart code when a background notification is received? #1018

@Kimsoer

Description

@Kimsoer

How can we help?

Dear OneSignal Team,

I’m using the OneSignal Flutter SDK (onesignal_flutter) in my app, and I have a specific use case where I need to trigger Dart code when a background notification is received. Currently, I understand that background notifications are handled natively by the OS, and there’s no direct way to execute Dart code when the app is in the background.

Is there any way to achieve this? For example:

Can we use data-only notifications to trigger Dart code in the background?

Is there a way to wake up the Dart isolate or execute custom logic when a background notification is received?

Are there any plans to support this feature in the future?

My use case involves displaying multiple local notifications when a background notification is received. I’d appreciate any guidance or workarounds you can provide.

Thank you!

Code of Conduct

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions