Skip to content

[firebase_messaging] functions are not triggered inside notification callback #3781

Closed
@apoleo88

Description

@apoleo88

When a notification arrives, it triggers correctly onMessage(and the others), but it doesn't trigger the function call inside it.

_fcm.configure(
      onMessage: (Map<String, dynamic> message) async {
        print("onMessage: $message"); // this is printed
        // static function:
        thisWeirdNotification(message['data']); // this is not called
      },
      ...
)
onMessage: {
  notification: {title: "yeaah", body: null},
  data: {channel_id: "chanel-name", info: "1", click_action: FLUTTER_NOTIFICATION_CLICK}
}
[√] Flutter (Channel master, 1.23.0-8.0.pre.124, on Microsoft Windows [Versione 10.0.19041.508], locale it-IT)
    • Flutter version 1.23.0-8.0.pre.124 at C:\src\flutter
    • Framework revision cbf1e135c4 (3 days ago), 2020-10-02 21:57:04 -0700
    • Engine revision 87a10f240f
    • Dart version 2.11.0 (build 2.11.0-181.0.dev)


[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    • Android SDK at C:\Users\_Apoleo\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.1
    • Java binary at: C:\Users\_Apoleo\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-1\193.6626763\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Android Studio (version 4.0)
    • Android Studio at C:\Users\_Apoleo\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-1\193.6626763
    • Flutter plugin version 47.1.1
    • Dart plugin version 192.8052
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] Connected device (1 available)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)

• No issues found!

I am not sure what's happening because the execution truncates without errors, is it suppressing one?

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