Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[firebase_messaging]: Only notification shown, no callbacks #17207

Closed
1 task done
komaxx opened this issue Mar 17, 2025 · 9 comments
Closed
1 task done

[firebase_messaging]: Only notification shown, no callbacks #17207

komaxx opened this issue Mar 17, 2025 · 9 comments
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: android Issues / PRs which are specifically for Android. plugin: messaging type: bug Something isn't working

Comments

@komaxx
Copy link
Contributor

komaxx commented Mar 17, 2025

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Messaging

Which platforms are affected?

Android

Description

For a small set of my users, push message processing does not work as expected: When a push message comes in while the app is in background / screen is off, the device will wake up but only show the system notification. The notification sound of the referenced notification channel will play once but then the screen will turn off again and phone goes back to sleep.

What should happen would be a call to onBackgroundMessage so that my code can do additional things, like bringing the app to front and do a lot more ringing (the push message is for incoming VoIP calls).
Then, even when the user taps the system notification to open the app, it will open but onMessageOpenedApp will not be called and getInitialMessage will deliver null.

The weird thing is that this only happens for a subset of devices with no discernible features (seen on Android 12 to 14 devices of various makes (Google Pixel, Samsung S series, Spectralink, ..) - but for those devices it's quite permanent: The issue will happen for every push message, and not go away when re-booting the phone, or re-installing the app.

I've already checked:

  • Battery optimizations are deactivated
  • Push Payload is identical to other phones where it works
  • Notification Channels are properly registered and active
  • All permissions were granted by the user

Also, I've dug a bit into the source code of the flutterfire source code, and if I understand correctly, the first Log message that I should see for every push notification would be from this line in FlutterFirebaseMessagingReceiver:

Log.d(TAG, "broadcast received for message");

On devices where the issue is present, I do not see this log message in system bug reports, in other devices, I can see it. So maybe this is an issue of the Google Play Services?

Any recommendation of where to continue debugging would be greatly appreciated!

Reproducing the issue

Unfortunately I can not provide such an example. The issue only appeared on devices of a few users; none are under my control and I'll not be able to convince them to install test apps for test pushes.

Firebase Core version

3.10.1

Flutter Version

3.27.0

Relevant Log Output

Not sure if relevant but here's a snippet of the system log from a Samsung Galaxy S22, starting with the reception of the push message (I think), and filtered for the process IDs of the NotificationManager and my app. My app's package name is replaced with <my_package_name>.

03-14 15:01:48.822 10228 17736 17736 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.constellation.service.START pkg=com.google.android.gms }
03-14 15:01:48.823 10228 17736 17736 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.auth.api.phone.service.SmsRetrieverApiService.START pkg=com.google.android.gms }
03-14 15:01:58.537 10228 11028  9421 D ConnectivityManager: StackLog: [android.net.ConnectivityManager.reportNetworkConnectivity(ConnectivityManager.java:3667)] [bjqb.a(:com.google.android.gms@[email protected] (190400-731361394):15)] [bjsk.p(:com.google.android.gms@[email protected] (190400-731361394):6)] [bjrd.a(:com.google.android.gms@[email protected] (190400-731361394):626)] [bjrx.run(:com.google.android.gms@[email protected] (190400-731361394):15)] [bjsv.run(:com.google.android.gms@[email protected] (190400-731361394):5)] [fgxx.run(:com.google.android.gms@[email protected] (190400-731361394):21)] [atru.c(:com.google.android.gms@[email protected] (190400-731361394):50)] [atru.run(:com.google.android.gms@[email protected] (190400-731361394):76)] [java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)] [java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)] [atxi.run(:com.google.android.gms@[email protected] (190400-731361394):8)] [java.lang.
03-14 15:01:58.540 10228 11028  9421 I AlarmManager: setExactAndAllowWhileIdle [name: GCM_HB_ALARM type: 2 triggerAtMillis: 598181247]
03-14 15:01:58.540  1000  2602  3488 D AlarmManager: force change alarm method to setWindow() callingUid=10228, sourcePackage=com.google.android.gms, action=com.google.android.gms.gcm.HEARTBEAT_ALARM, origTriggerAtTime=598181247, triggerAtTime=597436248, windowLength=744999
03-14 15:01:58.562 10228 11028  9538 I NotificationManager: com.google.android.gms: notify(0, FCM-Notification:94560824, Notification(channel=alarm_channel_id AppRingtone3 shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x10 color=0x00000000 vis=PUBLIC semFlags=0x0 semPriority=0 semMissedCount=0)) as package
03-14 15:01:58.568 10228 11028  7485 I AlarmManager: setExactAndAllowWhileIdle [name: GCM_HB_ALARM type: 2 triggerAtMillis: 598181276]
03-14 15:01:58.569  1000  2602  3488 D AlarmManager: force change alarm method to setWindow() callingUid=10228, sourcePackage=com.google.android.gms, action=com.google.android.gms.gcm.HEARTBEAT_ALARM, origTriggerAtTime=598181276, triggerAtTime=597436276, windowLength=745000
03-14 15:01:58.779  1000  2602  2602 D EdgeLightingManager: showForNotification : isInteractive=false, isHeadUp=true, color=0, canBypassDnd=true, sbn = StatusBarNotification(pkg=<my_package_name> user=UserHandle{0} id=0 tag=FCM-Notification:94560824 key=0|<my_package_name>|0|FCM-Notification:94560824|10370: Notification(channel=alarm_channel_id AppRingtone3 shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x10 color=0x00000000 vis=PUBLIC semFlags=0x0 semPriority=0 semMissedCount=0))
03-14 15:01:58.784  1000  2602  2602 D EdgeLightingPolicyManager: isAcceptableApplication - accept rechecked by isEdgeLightingAllowed = true uid = 10370
03-14 15:01:58.842 10035  3897  3897 D InterruptionStateProvider: No  Heads up : DISABLE_HEADS_UP 0|<my_package_name>|0|FCM-Notification:94560824|10370
03-14 15:01:58.842 10130  4331  6266 I HoneySpace.NotificationListener: onNotificationPosted <my_package_name>: 0|<my_package_name>|0|FCM-Notification:94560824|10370: 0
03-14 15:01:58.849 10035  3897  3897 D InterruptionStateProvider: No  Heads up : DISABLE_HEADS_UP 0|<my_package_name>|0|FCM-Notification:94560824|10370
03-14 15:01:58.904  1000  2602  4112 D PowerManagerService: [api] acquire WakeLock DRAW_WAKE_LOCK                 '@Inflate:0|<my_package_name>|0|FCM-Notification:94560824|10370' (uid=10035 pid=3897 displayId=-1 lock=cd35e93)
03-14 15:01:58.936 10035  3897  3897 D S.S.N.  : entryViewBound parent :0|<my_package_name>|0|FCM-Notification:94560824|10370
03-14 15:01:58.937  1000  2602  4112 D PowerManagerService: [api] release WakeLock DRAW_WAKE_LOCK                 '@Inflate:0|<my_package_name>|0|FCM-Notification:94560824|10370' ACQ=-33ms (uid=10035 pid=3897 displayId=-1 lock=cd35e93)
03-14 15:01:58.964 10035  3897  3897 D PluginAODManager: onNotificationInfoUpdated() 0|<my_package_name>|0|FCM-Notification:94560824|10370
03-14 15:01:59.106 10035  9548  9548 I NotificationEffect: setEdgeEffectInfo:  dur=4000 hasActionButton=false isGrayScaled= false color=ff0f2785 notificationKey=0|<my_package_name>|0|FCM-Notification:94560824|10370 actionEnable= true
03-14 15:01:59.113  1000  2602  2708 D DisplayManagerService: Ignore redundant display event 0/2 to 10370/23359
03-14 15:01:59.117 10228 11028 11028 I NearbyDiscovery: (REDACTED) FastPairDisplayObserver: %s -> %s
03-14 15:01:59.525  1000  2602  9542 D VibratorManagerService: vibrate - uid: 1000, opPkg: android, effect: Mono{mEffect=Composed{segments=[SemHaptic{mType=50034, mMagnitude=-1}], repeat=-1, mMagnitudeType=TYPE_NOTIFICATION}}, attrs: VibrationAttributes: Usage=ALARM Audio Usage= USAGE_ALARM tags= Flags=0, reason: Notification (com.google.android.gms 10370) (Delayed), token: android.os.Binder@aed51
03-14 15:01:59.779 10228 11028 11049 I FacsCacheGmsModule: (REDACTED) Receiving API connection to FACS API from package '%s'...
03-14 15:01:59.780 10228 11028 11049 I FacsCacheGmsModule: API connection successful!
03-14 15:01:59.788 10228 11028 11049 I FacsCacheGmsModule: (REDACTED) Received 'getActivityControlsSettings' request from package '%s', instance id '%s', version '%d'...
03-14 15:01:59.788 10228 11028 11049 I FacsCacheGmsModule: Operation 'getActivityControlsSettings' dispatched!
03-14 15:01:59.788 10228 11028  9495 I FacsCacheGmsModule: (REDACTED) Executing operation '%s'...
03-14 15:01:59.790 10228 17736 17736 D BoundBrokerSvc: onBind: Intent { act=com.google.android.gms.facs.internal.service.START dat=chimera-action:/... cmp=com.google.android.gms/.chimera.GmsInternalApiService }
03-14 15:01:59.790 10228 17736 17736 D BoundBrokerSvc: Loading bound service for intent: Intent { act=com.google.android.gms.facs.internal.service.START dat=chimera-action:/... cmp=com.google.android.gms/.chimera.GmsInternalApiService }
03-14 15:01:59.797 10228 17736 17752 I FacsCacheGmsModule: Receiving API connection to internal FACS API...
03-14 15:01:59.799 10228 17736 17752 I FacsCacheGmsModule: API connection successful!
03-14 15:01:59.800 10228 11028  9495 I FacsCacheGmsModule: (REDACTED) Operation '%s' successful!
03-14 15:01:59.802 10228 11028  7485 I NearbySharing: Not consented to upload device contacts.
03-14 15:01:59.802 10228 11028  7485 I NearbySharing: Syncing contacts - device contacts consent not granted
03-14 15:01:59.805  1000  2602  4222 D CompatibilityChangeReporter: Compat change id reported: 201794303; UID 10228; state: ENABLED
03-14 15:01:59.805  1000  2602  4222 D CompatibilityChangeReporter: Compat change id reported: 207133734; UID 10228; state: ENABLED
03-14 15:02:00.532  1000  2602  2708 D DisplayManagerService: Ignore redundant display event 0/2 to 10370/23359
03-14 15:02:00.540 10228 11028 11028 I NearbyDiscovery: (REDACTED) FastPairDisplayObserver: %s -> %s
03-14 15:02:00.630  1000  2602  2708 D DisplayManagerService: Ignore redundant display event 0/2 to 10370/23359
03-14 15:02:03.125 10035  9548  9548 D NotificationLightingScheduler: expiredNotiLighting: remove=0|<my_package_name>|0|FCM-Notification:94560824|10370
03-14 15:02:03.191  1000  2602  2708 D DisplayManagerService: Ignore redundant display event 0/2 to 10370/23359
03-14 15:02:03.202 10228 11028 11028 I NearbyDiscovery: (REDACTED) FastPairDisplayObserver: %s -> %s
03-14 15:02:03.208  1000  2602  2708 D DisplayManagerService: Ignore redundant display event 0/2 to 10370/23359
03-14 15:02:03.718 10228 11028 11028 I NearbyDiscovery: (REDACTED) FastPairDisplayObserver: %s -> %s
03-14 15:02:03.719 10228 11028  2605 I NearbyDiscovery: (REDACTED) OffloadFastPairScanner: eventType=%s, isInternalReq=%s, isOffloadScanning=%s, isOffloadScanningAllowed=%s
03-14 15:02:03.720 10228 11028  2605 I NearbyDiscovery: (REDACTED) FastPairScanner: isScreenOn=%s, isLocationEnabled=%s, disableLocationRequirement=%s, isDiscoveryScanningEnabled=%s, during24GhzWifiWarmingUpPeriod=%s
03-14 15:02:03.721 10228 11028  2605 D BluetoothAdapter: isLeEnabled(): ON
03-14 15:02:03.721 10228 11028  2605 I NearbyDiscovery: (REDACTED) FastPairScanner: eventType=%s, intReq=%s, scanning=%s, scanAllowed=%s, bleEnabled=%s, lockScanRate=%s, startScanningByLowPowerMode=%s
03-14 15:02:05.207 10228 17736 17736 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.potokens.service.START dat=chimera-action:/... cmp=com.google.android.gms/.chimera.GmsApiService }
03-14 15:02:05.461 10228 11028  9495 I NearbyPresence: (REDACTED) %s verified [==] new request %s equals to the old request
03-14 15:02:10.980  1000  2602  2708 D DisplayManagerService: Ignore redundant display event 0/2 to 10370/23359
03-14 15:02:10.994 10228 11028 11028 I NearbyDiscovery: (REDACTED) FastPairDisplayObserver: %s -> %s
03-14 15:02:10.994 10228 11028  2605 I NearbyDiscovery: (REDACTED) OffloadFastPairScanner: eventType=%s, isInternalReq=%s, isOffloadScanning=%s, isOffloadScanningAllowed=%s
03-14 15:02:10.996 10228 11028  2605 I NearbyDiscovery: (REDACTED) FastPairScanner: isScreenOn=%s, isLocationEnabled=%s, disableLocationRequirement=%s, isDiscoveryScanningEnabled=%s, during24GhzWifiWarmingUpPeriod=%s
03-14 15:02:10.996 10228 11028  2605 D BluetoothAdapter: isLeEnabled(): ON
03-14 15:02:10.996 10228 11028  2605 I NearbyDiscovery: (REDACTED) FastPairScanner: eventType=%s, intReq=%s, scanning=%s, scanAllowed=%s, bleEnabled=%s, lockScanRate=%s, startScanningByLowPowerMode=%s
03-14 15:02:11.018  1000  2602  2708 D DisplayManagerService: Ignore redundant display event 0/4 to 10370/23359
03-14 15:02:11.022 10035  3897  3897 D PluginAODManager: onNotificationInfoUpdated() 0|<my_package_name>|0|FCM-Notification:94560824|10370
03-14 15:02:11.064 10228 11028  2605 I NearbyDiscovery: (REDACTED) FastPairScanner: isScreenOn=%s, isLocationEnabled=%s, disableLocationRequirement=%s, isDiscoveryScanningEnabled=%s, during24GhzWifiWarmingUpPeriod=%s
03-14 15:02:11.064 10228 11028  2605 I NearbyDiscovery: (REDACTED) FastPairScanner: Start scanning internally, %s
03-14 15:02:11.064 10228 11028  2605 D BluetoothAdapter: getBleEnabledArray(): ON
03-14 15:02:11.066 10228 11028  2605 D BluetoothAdapter: semIsBleEnabled(): ON
03-14 15:02:11.066 10228 11028  2605 D BluetoothAdapter: getBleEnabledArray(): ON
03-14 15:02:11.066 10228 11028  2605 D BluetoothLeScanner: Start Scan with callback
03-14 15:02:11.067  1002  4273  4568 D BtGatt.ContextMap: add() - appUid: 10228, appPid: 0, appName: com.google.uid.shared, uuid : 4d3fa104-9d7b-4098-8ed1-77c292e8d316
03-14 15:02:11.067 10228 11028 11505 D BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=3 mScannerId=0
03-14 15:02:11.074 10228 11028  2605 I NearbyDiscovery: (REDACTED) FastPairScanner: Start scanning, mode=%s

Flutter dependencies

Expand Flutter dependencies snippet
dependencies:
- android_alarm_manager_plus 4.0.7 [flutter]
- audioplayers 6.2.0 [audioplayers_android audioplayers_darwin audioplayers_linux audioplayers_platform_interface audioplayers_web audioplayers_windows file flutter http meta path_provider synchronized uuid]
- collection 1.19.1
- cronet_http 1.3.2 [flutter http http_profile jni]
- crypto 3.0.6 [typed_data]
- cupertino_http 2.0.2 [async ffi flutter http http_profile objective_c web_socket]
- device_info_plus 11.3.3 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta web win32 win32_registry]
- encrypt 5.0.3 [args asn1lib clock collection crypto pointycastle]
- firebase_core 3.12.1 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_messaging 15.2.4 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- flic_button 1.2.6 [flutter logging]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
- flutter_archive 6.0.3 [flutter]
- flutter_background_service 5.1.0 [flutter flutter_background_service_platform_interface flutter_background_service_android flutter_background_service_ios]
- flutter_email_sender 7.0.0 [flutter]
- flutter_inappwebview 6.1.5 [flutter flutter_inappwebview_platform_interface flutter_inappwebview_android flutter_inappwebview_ios flutter_inappwebview_macos flutter_inappwebview_web flutter_inappwebview_windows]
- flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math]
- flutter_markdown 0.7.6+2 [flutter markdown meta path]
- flutter_pdfview 1.4.0 [flutter]
- flutter_secure_storage 9.0.0 [flutter flutter_secure_storage_linux flutter_secure_storage_macos flutter_secure_storage_platform_interface flutter_secure_storage_web flutter_secure_storage_windows meta]
- flutter_svg 2.0.17 [flutter http vector_graphics vector_graphics_codec vector_graphics_compiler]
- flutter_volume_controller 1.3.3 [flutter flutter_plugin_android_lifecycle]
- flutter_zxing 1.8.2 [camera ffi flutter image image_picker]
- focus_detector_v2 3.1.0+1 [flutter visibility_detector]
- http 1.3.0 [async http_parser meta web]
- image_picker 1.1.2 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_linux image_picker_macos image_picker_platform_interface image_picker_windows]
- intl 0.20.2 [clock meta path]
- intl_utils 2.8.10 [analyzer archive args dart_style http intl path petitparser yaml]
- location 7.0.1 [flutter location_platform_interface location_web]
- native_plugin 0.0.2 [flutter flutter_web_plugins]
- nfc_manager 3.5.0 [flutter]
- package_info_plus 8.3.0 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface web win32 clock]
- path_provider 2.1.5 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows]
- provider 6.1.2 [collection flutter nested]
- rxdart 0.28.0
- sensors_plus 6.1.1 [flutter flutter_web_plugins sensors_plus_platform_interface]
- share_plus 10.1.4 [cross_file meta mime flutter flutter_web_plugins share_plus_platform_interface file url_launcher_web url_launcher_windows url_launcher_linux url_launcher_platform_interface ffi web win32]
- shared_preferences 2.5.2 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- shimmer 3.0.0 [flutter]
- sip_ua 1.0.1 [collection crypto flutter_webrtc intl logger path random_string recase sdp_transform text uuid]
- timeago 3.7.0 [intl]
- url_launcher 6.3.1 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
- video_player 2.9.3 [flutter html video_player_android video_player_avfoundation video_player_platform_interface video_player_web]

dev dependencies:
- build_runner 2.4.15 [analyzer args async build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web web_socket_channel yaml]
- fake_async 1.3.2 [clock collection]
- flutter_gen_runner 5.10.0 [flutter_gen_core build collection crypto glob path yaml]
- flutter_launcher_icons 0.14.3 [args checked_yaml cli_util image json_annotation path yaml]
- flutter_lints 5.0.0 [lints]
- flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math leak_tracker_flutter_testing async boolean_selector characters collection leak_tracker leak_tracker_testing material_color_utilities meta source_span stream_channel string_scanner term_glyph vm_service]
- integration_test 0.0.0 [flutter flutter_driver flutter_test path vm_service async boolean_selector characters clock collection fake_async file leak_tracker leak_tracker_flutter_testing leak_tracker_testing matcher material_color_utilities meta source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api vector_math webdriver]
- mocktail 1.0.4 [collection matcher test_api]

dependency overrides:
- flutter_secure_storage 9.0.0 [flutter flutter_secure_storage_linux flutter_secure_storage_macos flutter_secure_storage_platform_interface flutter_secure_storage_web flutter_secure_storage_windows meta]
- intl 0.20.2 [clock meta path]
- location 7.0.1 [flutter location_platform_interface location_web]

transitive dependencies:
- _fe_analyzer_shared 80.0.0 [meta]
- _flutterfire_internals 1.3.53 [collection firebase_core firebase_core_platform_interface flutter meta]
- analyzer 7.3.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- archive 4.0.4 [crypto path posix]
- args 2.6.0
- asn1lib 1.6.0
- async 2.12.0 [collection meta]
- audioplayers_android 5.0.3 [audioplayers_platform_interface flutter]
- audioplayers_darwin 6.1.0 [audioplayers_platform_interface flutter]
- audioplayers_linux 4.1.0 [audioplayers_platform_interface flutter]
- audioplayers_platform_interface 7.0.0 [collection flutter meta plugin_platform_interface]
- audioplayers_web 5.0.1 [audioplayers_platform_interface flutter flutter_web_plugins web]
- audioplayers_windows 4.1.0 [audioplayers_platform_interface flutter]
- boolean_selector 2.1.2 [source_span string_scanner]
- build 2.4.2 [analyzer async convert crypto glob logging meta package_config path]
- build_config 1.1.2 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 4.0.4 [built_collection built_value crypto http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.4.4 [analyzer async build collection convert crypto graphs logging package_config path pool pub_semver stream_transform yaml]
- build_runner_core 8.0.0 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta package_config path pool timing watcher yaml]
- built_collection 5.1.1
- built_value 8.9.5 [built_collection collection fixnum meta]
- camera 0.11.1 [camera_android_camerax camera_avfoundation camera_platform_interface camera_web flutter flutter_plugin_android_lifecycle]
- camera_android_camerax 0.6.14 [async camera_platform_interface flutter meta stream_transform]
- camera_avfoundation 0.9.18+9 [camera_platform_interface flutter stream_transform]
- camera_platform_interface 2.9.0 [cross_file flutter plugin_platform_interface stream_transform]
- camera_web 0.3.5 [camera_platform_interface flutter flutter_web_plugins stream_transform web]
- characters 1.4.0
- checked_yaml 2.0.3 [json_annotation source_span yaml]
- cli_util 0.4.2 [meta path]
- clock 1.1.2
- code_builder 4.10.1 [built_collection built_value collection matcher meta]
- color 3.0.0
- convert 3.1.2 [typed_data]
- cross_file 0.3.4+2 [meta web]
- csslib 1.0.2 [source_span]
- dart_style 3.0.1 [analyzer args collection package_config path pub_semver source_span yaml]
- dart_webrtc 1.5.2+hotfix.1 [collection js logging meta synchronized web webrtc_interface]
- dartx 1.2.0 [characters collection crypto meta path time]
- device_info_plus_platform_interface 7.0.2 [flutter meta plugin_platform_interface]
- ffi 2.1.4
- file 7.0.1 [meta path]
- file_selector_linux 0.9.3+2 [cross_file file_selector_platform_interface flutter]
- file_selector_macos 0.9.4+2 [cross_file file_selector_platform_interface flutter]
- file_selector_platform_interface 2.6.2 [cross_file flutter http plugin_platform_interface]
- file_selector_windows 0.9.3+4 [cross_file file_selector_platform_interface flutter]
- firebase_core_platform_interface 5.4.0 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.21.1 [firebase_core_platform_interface flutter flutter_web_plugins meta web]
- firebase_messaging_platform_interface 4.6.4 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 3.10.4 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins meta web]
- fixnum 1.1.1
- flutter_background_service_android 6.3.0 [flutter flutter_background_service_platform_interface]
- flutter_background_service_ios 5.0.3 [flutter flutter_background_service_platform_interface]
- flutter_background_service_platform_interface 5.1.2 [flutter platform plugin_platform_interface]
- flutter_driver 0.0.0 [file flutter flutter_test fuchsia_remote_debug_protocol path meta vm_service webdriver async boolean_selector characters clock collection leak_tracker leak_tracker_flutter_testing leak_tracker_testing matcher material_color_utilities platform process source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api vector_math]
- flutter_gen_core 5.10.0 [meta path yaml mime xml dartx color collection json_annotation glob dart_style archive args pub_semver vector_graphics_compiler image_size_getter]
- flutter_inappwebview_android 1.1.3 [flutter flutter_inappwebview_platform_interface]
- flutter_inappwebview_internal_annotations 1.2.0
- flutter_inappwebview_ios 1.1.2 [flutter flutter_inappwebview_platform_interface]
- flutter_inappwebview_macos 1.1.2 [flutter flutter_inappwebview_platform_interface]
- flutter_inappwebview_platform_interface 1.3.0+1 [flutter flutter_inappwebview_internal_annotations plugin_platform_interface]
- flutter_inappwebview_web 1.1.2 [flutter flutter_web_plugins web flutter_inappwebview_platform_interface]
- flutter_inappwebview_windows 0.6.0 [flutter flutter_inappwebview_platform_interface]
- flutter_plugin_android_lifecycle 2.0.27 [flutter]
- flutter_secure_storage_linux 1.2.2 [flutter flutter_secure_storage_platform_interface]
- flutter_secure_storage_macos 3.1.3 [flutter flutter_secure_storage_platform_interface]
- flutter_secure_storage_platform_interface 1.1.2 [flutter plugin_platform_interface]
- flutter_secure_storage_web 1.2.1 [flutter flutter_secure_storage_platform_interface flutter_web_plugins js]
- flutter_secure_storage_windows 3.1.2 [ffi flutter flutter_secure_storage_platform_interface path path_provider win32]
- flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math]
- flutter_webrtc 0.12.11 [collection dart_webrtc flutter path_provider web webrtc_interface]
- frontend_server_client 4.0.0 [async path]
- fuchsia_remote_debug_protocol 0.0.0 [process vm_service file meta path platform]
- glob 2.1.3 [async collection file path string_scanner]
- graphs 2.3.2 [collection]
- hashcodes 2.0.0
- html 0.15.5 [csslib source_span]
- http_multi_server 3.2.2 [async]
- http_parser 4.1.2 [collection source_span string_scanner typed_data]
- http_profile 0.1.0
- image 4.5.3 [archive meta xml]
- image_picker_android 0.8.12+21 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface]
- image_picker_for_web 3.0.6 [flutter flutter_web_plugins image_picker_platform_interface mime web]
- image_picker_ios 0.8.12+2 [flutter image_picker_platform_interface]
- image_picker_linux 0.2.1+1 [file_selector_linux file_selector_platform_interface flutter image_picker_platform_interface]
- image_picker_macos 0.2.1+2 [file_selector_macos file_selector_platform_interface flutter image_picker_platform_interface]
- image_picker_platform_interface 2.10.1 [cross_file flutter http plugin_platform_interface]
- image_picker_windows 0.2.1+1 [file_selector_platform_interface file_selector_windows flutter image_picker_platform_interface]
- image_size_getter 2.4.0 [collection hashcodes meta]
- io 1.0.5 [meta path string_scanner]
- jni 0.10.1 [args collection ffi package_config path plugin_platform_interface]
- js 0.6.7 [meta]
- json_annotation 4.9.0 [meta]
- leak_tracker 10.0.8 [clock collection meta path vm_service]
- leak_tracker_flutter_testing 3.0.9 [flutter leak_tracker leak_tracker_testing matcher meta]
- leak_tracker_testing 3.0.1 [leak_tracker matcher meta]
- lints 5.1.1
- lists 1.0.1 [meta]
- location_platform_interface 5.0.0 [flutter plugin_platform_interface]
- location_web 5.0.4 [flutter flutter_web_plugins http_parser js location_platform_interface web]
- logger 2.5.0
- logging 1.3.0
- markdown 7.3.0 [args meta]
- matcher 0.12.17 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.11.1 [collection]
- meta 1.16.0
- mime 2.0.0
- nested 1.0.0 [flutter]
- objective_c 4.1.0 [ffi flutter]
- package_config 2.1.1 [path]
- package_info_plus_platform_interface 3.2.0 [flutter meta plugin_platform_interface]
- path 1.9.1
- path_parsing 1.1.0 [meta vector_math]
- path_provider_android 2.2.15 [flutter path_provider_platform_interface]
- path_provider_foundation 2.4.1 [flutter path_provider_platform_interface]
- path_provider_linux 2.2.1 [ffi flutter path path_provider_platform_interface xdg_directories]
- path_provider_platform_interface 2.1.2 [flutter platform plugin_platform_interface]
- path_provider_windows 2.3.0 [ffi flutter path path_provider_platform_interface]
- petitparser 6.1.0 [meta collection]
- platform 3.1.6
- plugin_platform_interface 2.1.8 [meta]
- pointycastle 3.9.1 [collection convert js]
- pool 1.5.1 [async stack_trace]
- posix 6.0.1 [ffi meta path]
- process 5.0.3 [file path platform]
- pub_semver 2.1.5 [collection meta]
- pubspec_parse 1.5.0 [checked_yaml collection json_annotation pub_semver yaml]
- random_string 2.3.1
- recase 4.1.0
- sdp_transform 0.3.2
- sensors_plus_platform_interface 2.0.1 [flutter logging meta plugin_platform_interface]
- share_plus_platform_interface 5.0.2 [cross_file flutter meta mime plugin_platform_interface path_provider uuid]
- shared_preferences_android 2.4.7 [flutter shared_preferences_platform_interface]
- shared_preferences_foundation 2.5.4 [flutter shared_preferences_platform_interface]
- shared_preferences_linux 2.4.1 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface]
- shared_preferences_platform_interface 2.4.1 [flutter plugin_platform_interface]
- shared_preferences_web 2.4.3 [flutter flutter_web_plugins shared_preferences_platform_interface web]
- shared_preferences_windows 2.4.1 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface]
- shelf 1.4.2 [async collection http_parser path stack_trace stream_channel]
- shelf_web_socket 3.0.0 [shelf stream_channel web_socket_channel]
- sky_engine 0.0.0
- source_span 1.10.1 [collection path term_glyph]
- sprintf 7.0.0
- stack_trace 1.12.1 [path]
- stream_channel 2.1.4 [async]
- stream_transform 2.1.1
- string_scanner 1.4.1 [source_span]
- sync_http 0.3.1
- synchronized 3.3.1
- term_glyph 1.2.2
- test_api 0.7.4 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- text 0.2.0 [lists]
- time 2.1.5 [clock]
- timing 1.0.2 [json_annotation]
- typed_data 1.4.0 [collection]
- url_launcher_android 6.3.14 [flutter url_launcher_platform_interface]
- url_launcher_ios 6.3.2 [flutter url_launcher_platform_interface]
- url_launcher_linux 3.2.1 [flutter url_launcher_platform_interface]
- url_launcher_macos 3.2.2 [flutter url_launcher_platform_interface]
- url_launcher_platform_interface 2.3.2 [flutter plugin_platform_interface]
- url_launcher_web 2.4.0 [flutter flutter_web_plugins url_launcher_platform_interface web]
- url_launcher_windows 3.1.4 [flutter url_launcher_platform_interface]
- uuid 4.5.1 [crypto sprintf meta fixnum]
- vector_graphics 1.1.18 [flutter http vector_graphics_codec]
- vector_graphics_codec 1.1.13
- vector_graphics_compiler 1.1.16 [args meta path path_parsing vector_graphics_codec xml]
- vector_math 2.1.4
- video_player_android 2.8.0 [flutter video_player_platform_interface]
- video_player_avfoundation 2.7.0 [flutter video_player_platform_interface]
- video_player_platform_interface 6.3.0 [flutter plugin_platform_interface]
- video_player_web 2.3.4 [flutter flutter_web_plugins video_player_platform_interface web]
- visibility_detector 0.4.0+2 [flutter]
- vm_service 14.3.1
- watcher 1.1.1 [async path]
- web 1.1.1
- web_socket 0.1.6 [web]
- web_socket_channel 3.0.2 [async crypto stream_channel web web_socket]
- webdriver 3.0.4 [matcher path stack_trace sync_http]
- webrtc_interface 1.2.1+hotfix.1
- win32 5.11.0 [ffi]
- win32_registry 2.1.0 [ffi meta win32]
- xdg_directories 1.1.0 [meta path]
- xml 6.5.0 [collection meta petitparser]
- yaml 3.1.3 [collection source_span string_scanner]

Additional context and comments

No response

@komaxx komaxx added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Mar 17, 2025
@kirya355
Copy link

Thank you for providing detailed information about the issue. To better understand and debug the problem, it would be extremely helpful if you could create a minimal reproducible example that demonstrates the issue. This will allow us to isolate the problem and test potential solutions more effectively. Here are a few suggestions for the minimal example:

  1. Minimal Code: Provide a simplified version of your code that reproduces the issue. Focus on the parts related to Firebase Cloud Messaging (FCM) and VoIP call handling.
  2. Push Payload: Include the exact payload structure you’re using for the VoIP push notifications.
  3. Device Information: If possible, provide the specific device models and Android versions where the issue occurs.

Additionally, since this issue involves VoIP calls on Android, I recommend considering the use of Android's Telecom Library for handling VoIP calls. This library is designed to integrate VoIP calls more seamlessly with the Android system, ensuring better compatibility and reliability. You can find more information in the official Android documentation.

@komaxx
Copy link
Contributor Author

komaxx commented Mar 18, 2025

Hi!
Thank you for the response!
I'll try to create such a minimal example project - but I'm not even sure that it will even help: As discussed, the issue only manifests itself on a seemingly random set of phones :/

Thank you for the link to Android's Telecom Library! We're aware of that functionality but it does not fit too well with our use case, unfortunately.

@huynguyen2015
Copy link

huynguyen2015 commented Mar 18, 2025

I have the same issue. i'm going to write a report issue and i see this thread

FirebaseMessaging onMessage.listen Not Triggering After Reopening App on Samsung S22

📌 Issue Summary

On Samsung S22 (Android), FirebaseMessaging.onMessage.listen only fires the first time after the app is installed.

  • If the app is closed and reopened, onMessage.listen stops receiving messages.
  • If the payload only contains data, onMessage.listen works as expected.
  • However, if the payload contains both notification and data, onMessage.listen does not trigger after reopening the app, but the system notification still appears in the notification tray.

🔄 Steps to Reproduce

  1. Install and open the app for the first time.
  2. Send an FCM message with both notification and data properties via Postman:
   {
     "message": {
       "token": "DEVICE_FCM_TOKEN",
       "notification": {
         "title": "Test Notification",
         "body": "This is a test"
       },
       "data": {
         "key1": "value1",
         "key2": "value2"
       },
       "android": {
         "priority": "high"
       }
     }
   }
  1. onMessage.listen fires, and a notification appears.

  2. Background the app and send another notification.

    • Expected: System notification appears. ✅
  3. Reopen the app and send another notification.

    • Expected: onMessage.listen should trigger. ❌ (It does NOT trigger.)
    • Actual: No logs from onMessage.listen, but the notification appears in the system tray.
  4. Modify the payload to remove the notification property and resend the message.

{
  "message": {
    "token": "DEVICE_FCM_TOKEN",
    "data": {
      "title": "Test",
      "body": "This is a test",
      "key1": "value1"
    },
    "android": {
      "priority": "high"
    }
  }
}
  • Result: onMessage.listen starts working again. ✅

⚠️ Expected Behavior

  • onMessage.listen should trigger every time a new notification is received when the app is in the foreground.
  • The app should not stop receiving FCM messages in onMessage.listen after reopening.

⚙️ Affected Devices

  • Samsung S22 (Issue Occurs)
  • Samsung S21 (Likely Affected, Similar One UI Behavior)
  • 🆗 Emulator (Works as Expected)
  • 🆗 iOS (Works as Expected)

📌 Additional Observations

  • This issue only happens when both notification and data are included in the payload.
  • If only data is sent, onMessage.listen always triggers, even after reopening the app.
  • The issue might be related to Samsung's One UI and Firebase behavior in handling system notifications.

📢 Proposed Workarounds

  1. Use a data-only payload and manually display notifications with FlutterLocalNotificationsPlugin.

🛠 Flutter Environment

flutter: 3.x.x
firebase_messaging: ^15.2.4
flutter_local_notifications: ^17.2.1

🚀 Request for Firebase Team

Please investigate why Samsung S22 stops triggering onMessage.listen after reopening the app when sending both notification and data.

  • Is this expected behavior?
  • Can Firebase Messaging be modified to ensure onMessage.listen fires regardless of payload type?

🎯 Summary

✔ onMessage.listen works the first time after installation.
✔ It stops working after reopening the app if notification is included in the payload.
✔ If sending data-only, onMessage.listen always triggers.
✔ System notification still shows, but the event does not fire.

Would appreciate any insights or fixes for this issue! 🙏

@SelaseKay SelaseKay added plugin: messaging platform: android Issues / PRs which are specifically for Android. labels Mar 18, 2025
@onewilk
Copy link

onewilk commented Mar 19, 2025

same issues here.
pleasse fix this, it's important for my application. 🙏

@hussenIbrahim
Copy link

See this comment

@SelaseKay
Copy link
Contributor

Hi everyone, it looks like the workaround for this issue is opting out of Google Play Services notification delegation, as mentioned in @hussenIbrahim's linked comment. Could anyone confirm if this solution works for them?

@komaxx
Copy link
Contributor Author

komaxx commented Mar 19, 2025

I'm currently rolling out a version to beta users to test this. Will keep you posted if it works!

@SelaseKay SelaseKay added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Mar 19, 2025
@Kamuel09
Copy link

I am also experiencing the issue where RemoteMessage is being delivered as null on my Galaxy S25 Ultra.
In my case, I am using the Admin SDK for Python instead of REST.
How should I proceed with testing or making modifications in this situation?

@komaxx
Copy link
Contributor Author

komaxx commented Mar 21, 2025

Can confirm that the issue is, at least for my users, solved with deactivating delegation!

I achieved this by adding these lines in the inside of my AndroidManifest.xml file:

        <meta-data
            android:name="delivery_metrics_exported_to_big_query_enabled"
            android:value="false" />
        <meta-data
            android:name="firebase_messaging_notification_delegation_enabled"
            android:value="false" />

Those lines go into the <application>..</application> chunk, probably before the first <activity ..>

For me, this issue is thereby completed but I think it would make sense to add some documentation somewhere to not let others fall into the same trap!

@komaxx komaxx closed this as completed Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: android Issues / PRs which are specifically for Android. plugin: messaging type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants