Skip to content

FCM callbacks are not fired #50936

Closed
Closed
@locskot

Description

@locskot

firebase_core: ^0.4.4
firebase_analytics: ^5.0.11
firebase_crashlytics: ^0.1.2+5
firebase_remote_config: ^0.3.0+1
firebase_messaging: ^6.0.9

[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15 19A602, locale ru-RU)
• Flutter version 1.12.13+hotfix.8 at /Users/locskot/dev/sdk/flutter
• Framework revision 0b8abb4 (6 days ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced
• Dart version 2.7.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/locskot/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3.1, Build version 11C504
• CocoaPods version 1.7.5

[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 43.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (2 available)
• iPhone (Iaroslav) • 6071e5eeasd38d6e1feb9asdd89a20cbb4f79442e6b34d • ios • iOS 13.1.3
• iPhone 11 Pro Max • 811B15EA-66E8-4F40-AD29-3E1482B32A4E • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)

The code is the same.
The only onMessage fired on Simulator.
If the app is launched and in the background - onResume not triggered. When tap on app icon - app become visible and onMessage fired. Same for onLaunch callback. No system notification for both onLaunch and onResume callbacks.

For real device the only onLaunch fired. The device display system notification after receiving push. Tap on notification - the onLaunch code will execute If the app was not launched before. As expected, but another 2 callbacks do not work as expected.
Tap on notification - the onResume code will not execute If the app was launched before and staying in background (I used break points and logs). App just become visible and no more actions.
If app is launched and in foreground onMessage did not fired at all. But postman says messageId.

Below my postman push
{
"notification": {
"title": "New ride",
"body": "Great news",
},
"data": {
"trip_id" : "2057746",
}
"to": "eZ7iAktp3HY:APA91bHmKKTryWfk2Ux1xjxbYsGqPoOcmAp3ho_uDBcEu1YQS47LzYe_ZaG50Z-_Fw_K4tIMbeIIbgUwCDaYPaIDOODhmeJAJwnLf0-0xW9z2ocxsuTUD6eFiPeqH2YvgS8eG44STNMg"
}

Before updating flutter channel and packages in pubspec.yaml all callbacks (onMessage, onResume and onLaunch) working great.
Any ideas how to fix?

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