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]: setForegroundNotificationPresentationOptions to false not working / onMessage is never called #17124

Open
1 task done
ced1check opened this issue Feb 20, 2025 · 7 comments
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: ios Issues / PRs which are specifically for iOS. plugin: messaging type: bug Something isn't working

Comments

@ced1check
Copy link

ced1check commented Feb 20, 2025

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Messaging

Which platforms are affected?

iOS

Description

I use this code during initialization but it has no effect:

await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions();

or this, no effect as well:

await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions(
  alert: false,
  badge: false,
  sound: false,
);

Heads-up notifications are still showing on iOS.

And the method _firebaseRemoteMessage is never called on iOS, no matter what the setup is.

//  Listen to message while in foreground
_streamListening = FirebaseMessaging.onMessage.listen(_firebaseRemoteMessage);

On Android, no heads-up notification when app is in foreground, and onMessage is called automatically when needed.

It's not working as per documentation: Advanced usage

Reproducing the issue

  • Use example project
  • Change call to setForegroundNotificationPresentationOptions (all:false)
  • Run app in foreground
  • Go to settings and enable notification
  • Send message notification
  • Check logs, onMessage is not called, heads-up notification is shown

Firebase Core version

3.12.0

Flutter Version

3.24.0

Relevant Log Output

Flutter dependencies

Dart SDK 3.5.0
Flutter SDK 3.24.0
one_check 1.5.2+1
├── build_runner 2.4.9
│ ├── analyzer 5.13.0
│ │ ├── _fe_analyzer_shared 61.0.0
│ │ │ └── meta...
│ │ ├── convert 3.1.1
│ │ │ └── typed_data...
│ │ ├── collection...
│ │ ├── crypto...
│ │ ├── glob...
│ │ ├── meta...
│ │ ├── package_config...
│ │ ├── path...
│ │ ├── pub_semver...
│ │ ├── source_span...
│ │ ├── watcher...
│ │ └── yaml...
│ ├── args 2.5.0
│ ├── build 2.4.1
│ │ ├── analyzer...
│ │ ├── async...
│ │ ├── convert...
│ │ ├── crypto...
│ │ ├── glob...
│ │ ├── logging...
│ │ ├── meta...
│ │ ├── package_config...
│ │ └── path...
│ ├── build_config 1.1.1
│ │ ├── checked_yaml 2.0.3
│ │ │ ├── json_annotation...
│ │ │ ├── source_span...
│ │ │ └── yaml...
│ │ ├── json_annotation 4.9.0
│ │ │ └── meta...
│ │ ├── path...
│ │ ├── pubspec_parse...
│ │ └── yaml...
│ ├── build_daemon 4.0.1
│ │ ├── built_collection 5.1.1
│ │ ├── built_value 8.9.2
│ │ │ ├── fixnum 1.1.0
│ │ │ ├── built_collection...
│ │ │ ├── collection...
│ │ │ └── meta...
│ │ ├── crypto...
│ │ ├── http_multi_server...
│ │ ├── logging...
│ │ ├── path...
│ │ ├── pool...
│ │ ├── shelf...
│ │ ├── shelf_web_socket...
│ │ ├── stream_transform...
│ │ ├── watcher...
│ │ └── web_socket_channel...
│ ├── build_resolvers 2.4.2
│ │ ├── analyzer...
│ │ ├── async...
│ │ ├── build...
│ │ ├── collection...
│ │ ├── convert...
│ │ ├── crypto...
│ │ ├── graphs...
│ │ ├── logging...
│ │ ├── package_config...
│ │ ├── path...
│ │ ├── pool...
│ │ ├── pub_semver...
│ │ ├── stream_transform...
│ │ └── yaml...
│ ├── build_runner_core 7.3.0
│ │ ├── async...
│ │ ├── build...
│ │ ├── build_config...
│ │ ├── build_resolvers...
│ │ ├── collection...
│ │ ├── convert...
│ │ ├── crypto...
│ │ ├── glob...
│ │ ├── graphs...
│ │ ├── json_annotation...
│ │ ├── logging...
│ │ ├── meta...
│ │ ├── package_config...
│ │ ├── path...
│ │ ├── pool...
│ │ ├── timing...
│ │ ├── watcher...
│ │ └── yaml...
│ ├── code_builder 4.10.0
│ │ ├── built_collection...
│ │ ├── built_value...
│ │ ├── collection...
│ │ ├── matcher...
│ │ └── meta...
│ ├── dart_style 2.3.2
│ │ ├── analyzer...
│ │ ├── args...
│ │ ├── path...
│ │ ├── pub_semver...
│ │ └── source_span...
│ ├── frontend_server_client 4.0.0
│ │ ├── async...
│ │ └── path...
│ ├── glob 2.1.2
│ │ ├── async...
│ │ ├── collection...
│ │ ├── file...
│ │ ├── path...
│ │ └── string_scanner...
│ ├── graphs 2.3.1
│ │ └── collection...
│ ├── http_multi_server 3.2.1
│ │ └── async...
│ ├── io 1.0.4
│ │ ├── meta...
│ │ ├── path...
│ │ └── string_scanner...
│ ├── js 0.6.7
│ │ └── meta...
│ ├── logging 1.2.0
│ ├── mime 1.0.6
│ ├── package_config 2.1.0
│ │ └── path...
│ ├── pool 1.5.1
│ │ ├── async...
│ │ └── stack_trace...
│ ├── pub_semver 2.1.4
│ │ ├── collection...
│ │ └── meta...
│ ├── pubspec_parse 1.3.0
│ │ ├── checked_yaml...
│ │ ├── collection...
│ │ ├── json_annotation...
│ │ ├── pub_semver...
│ │ └── yaml...
│ ├── shelf 1.4.1
│ │ ├── async...
│ │ ├── collection...
│ │ ├── http_parser...
│ │ ├── path...
│ │ ├── stack_trace...
│ │ └── stream_channel...
│ ├── shelf_web_socket 1.0.4
│ │ ├── shelf...
│ │ ├── stream_channel...
│ │ └── web_socket_channel...
│ ├── stream_transform 2.1.0
│ ├── timing 1.0.1
│ │ └── json_annotation...
│ ├── watcher 1.1.0
│ │ ├── async...
│ │ └── path...
│ ├── web_socket_channel 2.4.0
│ │ ├── async...
│ │ ├── crypto...
│ │ └── stream_channel...
│ ├── yaml 3.1.2
│ │ ├── collection...
│ │ ├── source_span...
│ │ └── string_scanner...
│ ├── async...
│ ├── collection...
│ ├── crypto...
│ ├── meta...
│ ├── path...
│ └── stack_trace...
├── firebase_crashlytics 4.3.3
│ ├── firebase_core_platform_interface 5.4.0
│ │ ├── collection...
│ │ ├── flutter...
│ │ ├── flutter_test...
│ │ ├── meta...
│ │ └── plugin_platform_interface...
│ ├── firebase_crashlytics_platform_interface 3.8.3
│ │ ├── _flutterfire_internals 1.3.52
│ │ │ ├── collection...
│ │ │ ├── firebase_core...
│ │ │ ├── firebase_core_platform_interface...
│ │ │ ├── flutter...
│ │ │ └── meta...
│ │ ├── collection...
│ │ ├── firebase_core...
│ │ ├── flutter...
│ │ ├── meta...
│ │ └── plugin_platform_interface...
│ ├── stack_trace 1.11.1
│ │ └── path...
│ ├── firebase_core...
│ └── flutter...
├── flutter 0.0.0
│ ├── characters 1.3.0
│ ├── collection 1.18.0
│ ├── material_color_utilities 0.11.1
│ │ └── collection...
│ ├── meta 1.15.0
│ ├── sky_engine 0.0.99
│ └── vector_math 2.1.4
├── flutter_lints 3.0.2
│ └── lints 3.0.0
├── flutter_localizations 0.0.0
│ ├── clock 1.1.1
│ ├── intl 0.19.0
│ │ ├── clock...
│ │ ├── meta...
│ │ └── path...
│ ├── path 1.9.0
│ ├── characters...
│ ├── collection...
│ ├── flutter...
│ ├── material_color_utilities...
│ ├── meta...
│ └── vector_math...
├── flutter_test 0.0.0
│ ├── async 2.11.0
│ │ ├── collection...
│ │ └── meta...
│ ├── boolean_selector 2.1.1
│ │ ├── source_span...
│ │ └── string_scanner...
│ ├── fake_async 1.3.1
│ │ ├── clock...
│ │ └── collection...
│ ├── leak_tracker 10.0.5
│ │ ├── clock...
│ │ ├── collection...
│ │ ├── meta...
│ │ ├── path...
│ │ └── vm_service...
│ ├── leak_tracker_flutter_testing 3.0.5
│ │ ├── flutter...
│ │ ├── leak_tracker...
│ │ ├── leak_tracker_testing...
│ │ ├── matcher...
│ │ └── meta...
│ ├── leak_tracker_testing 3.0.1
│ │ ├── leak_tracker...
│ │ ├── matcher...
│ │ └── meta...
│ ├── matcher 0.12.16+1
│ │ ├── async...
│ │ ├── meta...
│ │ ├── stack_trace...
│ │ ├── term_glyph...
│ │ └── test_api...
│ ├── source_span 1.10.0
│ │ ├── collection...
│ │ ├── path...
│ │ └── term_glyph...
│ ├── stream_channel 2.1.2
│ │ └── async...
│ ├── string_scanner 1.2.0
│ │ └── source_span...
│ ├── term_glyph 1.2.1
│ ├── test_api 0.7.2
│ │ ├── async...
│ │ ├── boolean_selector...
│ │ ├── collection...
│ │ ├── meta...
│ │ ├── source_span...
│ │ ├── stack_trace...
│ │ ├── stream_channel...
│ │ ├── string_scanner...
│ │ └── term_glyph...
│ ├── vm_service 14.2.4
│ ├── characters...
│ ├── clock...
│ ├── collection...
│ ├── flutter...
│ ├── material_color_utilities...
│ ├── meta...
│ ├── path...
│ ├── stack_trace...
│ └── vector_math...
├── shared_features 1.5.2+1
│ ├── audio_session 0.1.21
│ │ ├── flutter_web_plugins 0.0.0
│ │ │ ├── characters...
│ │ │ ├── collection...
│ │ │ ├── flutter...
│ │ │ ├── material_color_utilities...
│ │ │ ├── meta...
│ │ │ └── vector_math...
│ │ ├── rxdart 0.27.7
│ │ ├── flutter...
│ │ └── meta...
│ ├── auto_size_text 3.0.0
│ │ └── flutter...
│ ├── badges 3.1.2
│ │ └── flutter...
│ ├── battery_plus 4.1.0
│ │ ├── battery_plus_platform_interface 1.2.2
│ │ │ ├── flutter...
│ │ │ ├── meta...
│ │ │ └── plugin_platform_interface...
│ │ ├── upower 0.7.0
│ │ │ └── dbus 0.7.10
│ │ │ ├── args...
│ │ │ ├── ffi...
│ │ │ ├── meta...
│ │ │ └── xml...
│ │ ├── flutter...
│ │ ├── flutter_web_plugins...
│ │ └── meta...
│ ├── cached_network_image 3.3.1
│ │ ├── cached_network_image_platform_interface 4.0.0
│ │ │ ├── flutter...
│ │ │ └── flutter_cache_manager...
│ │ ├── cached_network_image_web 1.2.0
│ │ │ ├── cached_network_image_platform_interface...
│ │ │ ├── flutter...
│ │ │ └── flutter_cache_manager...
│ │ ├── octo_image 2.1.0
│ │ │ └── flutter...
│ │ ├── flutter...
│ │ └── flutter_cache_manager...
│ ├── camera 0.10.5+9
│ │ ├── camera_android 0.10.9+2
│ │ │ ├── camera_platform_interface...
│ │ │ ├── flutter...
│ │ │ ├── flutter_plugin_android_lifecycle...
│ │ │ └── stream_transform...
│ │ ├── camera_avfoundation 0.9.13+10
│ │ │ ├── camera_platform_interface...
│ │ │ ├── flutter...
│ │ │ └── stream_transform...
│ │ ├── camera_platform_interface 2.8.0
│ │ │ ├── cross_file 0.3.4+2
│ │ │ │ ├── meta...
│ │ │ │ └── web...
│ │ │ ├── flutter...
│ │ │ ├── plugin_platform_interface...
│ │ │ └── stream_transform...
│ │ ├── camera_web 0.3.4
│ │ │ ├── camera_platform_interface...
│ │ │ ├── flutter...
│ │ │ ├── flutter_web_plugins...
│ │ │ └── stream_transform...
│ │ ├── flutter_plugin_android_lifecycle 2.0.19
│ │ │ └── flutter...
│ │ └── flutter...
│ ├── connectivity_plus 5.0.2
│ │ ├── connectivity_plus_platform_interface 1.2.4
│ │ │ ├── flutter...
│ │ │ ├── meta...
│ │ │ └── plugin_platform_interface...
│ │ ├── nm 0.5.0
│ │ │ └── dbus...
│ │ ├── flutter...
│ │ ├── flutter_web_plugins...
│ │ ├── js...
│ │ └── meta...
│ ├── country_codes 3.2.3+1
│ │ └── flutter...
│ ├── crypto 3.0.3
│ │ └── typed_data 1.3.2
│ │ └── collection...
│ ├── cupertino_icons 1.0.8
│ ├── dartz 0.10.1
│ ├── device_info_plus 11.3.0
│ │ ├── device_info_plus_platform_interface 7.0.2
│ │ │ ├── flutter...
│ │ │ ├── meta...
│ │ │ └── plugin_platform_interface...
│ │ ├── ffi 2.1.3
│ │ ├── file 7.0.0
│ │ │ ├── meta...
│ │ │ └── path...
│ │ ├── web 1.1.0
│ │ ├── win32 5.10.1
│ │ │ └── ffi...
│ │ ├── win32_registry 1.1.2
│ │ │ ├── ffi...
│ │ │ └── win32...
│ │ ├── flutter...
│ │ ├── flutter_web_plugins...
│ │ └── meta...
│ ├── diacritic 0.1.6
│ ├── dio 5.7.0
│ │ ├── dio_web_adapter 1.0.1
│ │ │ ├── dio...
│ │ │ ├── http_parser...
│ │ │ └── meta...
│ │ ├── http_parser 4.0.2
│ │ │ ├── collection...
│ │ │ ├── source_span...
│ │ │ ├── string_scanner...
│ │ │ └── typed_data...
│ │ ├── async...
│ │ ├── meta...
│ │ └── path...
│ ├── easy_date_timeline 1.1.3
│ │ ├── flutter...
│ │ └── intl...
│ ├── equatable 2.0.5
│ │ ├── collection...
│ │ └── meta...
│ ├── firebase_core 3.12.0
│ │ ├── firebase_core_web 2.21.0
│ │ │ ├── firebase_core_platform_interface...
│ │ │ ├── flutter...
│ │ │ ├── flutter_web_plugins...
│ │ │ ├── meta...
│ │ │ └── web...
│ │ ├── firebase_core_platform_interface...
│ │ ├── flutter...
│ │ └── meta...
│ ├── firebase_messaging 15.2.3
│ │ ├── firebase_messaging_platform_interface 4.6.3
│ │ │ ├── _flutterfire_internals...
│ │ │ ├── firebase_core...
│ │ │ ├── flutter...
│ │ │ ├── meta...
│ │ │ └── plugin_platform_interface...
│ │ ├── firebase_messaging_web 3.10.3
│ │ │ ├── _flutterfire_internals...
│ │ │ ├── firebase_core...
│ │ │ ├── firebase_core_web...
│ │ │ ├── firebase_messaging_platform_interface...
│ │ │ ├── flutter...
│ │ │ ├── flutter_web_plugins...
│ │ │ ├── meta...
│ │ │ └── web...
│ │ ├── firebase_core...
│ │ ├── firebase_core_platform_interface...
│ │ ├── flutter...
│ │ └── meta...
│ ├── flutter_app_badger 1.5.0
│ │ └── flutter...
│ ├── flutter_archive 5.0.0
│ │ └── flutter...
│ ├── flutter_bloc 8.1.6
│ │ ├── bloc 8.1.4
│ │ │ └── meta...
│ │ ├── provider 6.1.2
│ │ │ ├── nested 1.0.0
│ │ │ │ └── flutter...
│ │ │ ├── collection...
│ │ │ └── flutter...
│ │ └── flutter...
│ ├── flutter_cache_manager 3.3.1
│ │ ├── http 1.3.0
│ │ │ ├── async...
│ │ │ ├── http_parser...
│ │ │ ├── meta...
│ │ │ └── web...
│ │ ├── clock...
│ │ ├── collection...
│ │ ├── file...
│ │ ├── flutter...
│ │ ├── path...
│ │ ├── path_provider...
│ │ ├── rxdart...
│ │ ├── sqflite...
│ │ └── uuid...
│ ├── flutter_drawing_board 0.5.0
│ │ └── flutter...
│ ├── flutter_hooks 0.20.5
│ │ └── flutter...
│ ├── flutter_internet_signal 0.0.30
│ │ ├── plugin_platform_interface 2.1.8
│ │ │ └── meta...
│ │ └── flutter...
│ ├── flutter_keyboard_visibility 6.0.0
│ │ ├── flutter_keyboard_visibility_linux 1.0.0
│ │ │ ├── flutter...
│ │ │ └── flutter_keyboard_visibility_platform_interface...
│ │ ├── flutter_keyboard_visibility_macos 1.0.0
│ │ │ ├── flutter...
│ │ │ └── flutter_keyboard_visibility_platform_interface...
│ │ ├── flutter_keyboard_visibility_platform_interface 2.0.0
│ │ │ ├── flutter...
│ │ │ ├── meta...
│ │ │ └── plugin_platform_interface...
│ │ ├── flutter_keyboard_visibility_web 2.0.0
│ │ │ ├── flutter...
│ │ │ ├── flutter_keyboard_visibility_platform_interface...
│ │ │ └── flutter_web_plugins...
│ │ ├── flutter_keyboard_visibility_windows 1.0.0
│ │ │ ├── flutter...
│ │ │ └── flutter_keyboard_visibility_platform_interface...
│ │ ├── flutter...
│ │ └── meta...
│ ├── flutter_local_notifications 17.2.4
│ │ ├── flutter_local_notifications_linux 4.0.1
│ │ │ ├── xdg_directories 1.0.4
│ │ │ │ ├── meta...
│ │ │ │ └── path...
│ │ │ ├── dbus...
│ │ │ ├── ffi...
│ │ │ ├── flutter...
│ │ │ ├── flutter_local_notifications_platform_interface...
│ │ │ └── path...
│ │ ├── flutter_local_notifications_platform_interface 7.2.0
│ │ │ ├── flutter...
│ │ │ └── plugin_platform_interface...
│ │ ├── clock...
│ │ ├── flutter...
│ │ └── timezone...
│ ├── flutter_logs 2.1.12
│ │ ├── platform 3.1.5
│ │ └── flutter...
│ ├── flutter_pdfview 1.3.4
│ │ └── flutter...
│ ├── flutter_sound 9.2.13
│ │ ├── flutter_sound_platform_interface 9.2.13
│ │ │ ├── flutter...
│ │ │ ├── logger...
│ │ │ ├── meta...
│ │ │ └── plugin_platform_interface...
│ │ ├── flutter_sound_web 9.2.13
│ │ │ ├── flutter...
│ │ │ ├── flutter_sound_platform_interface...
│ │ │ ├── flutter_web_plugins...
│ │ │ ├── js...
│ │ │ ├── logger...
│ │ │ └── meta...
│ │ ├── logger 1.4.0
│ │ ├── recase 4.1.0
│ │ ├── synchronized 3.1.0+1
│ │ ├── flutter...
│ │ ├── path...
│ │ ├── path_provider...
│ │ ├── provider...
│ │ └── uuid...
│ ├── flutter_sound_record_platform_interface 0.3.1
│ │ ├── flutter...
│ │ └── plugin_platform_interface...
│ ├── flutter_spinbox 0.13.1
│ │ ├── cupertino_icons...
│ │ ├── flutter...
│ │ └── meta...
│ ├── flutter_time_picker_spinner 2.0.0
│ │ └── flutter...
│ ├── flutter_timezone 1.0.8
│ │ ├── flutter...
│ │ ├── flutter_web_plugins...
│ │ └── js...
│ ├── font_awesome_flutter 10.7.0
│ │ └── flutter...
│ ├── geolocator 10.1.1
│ │ ├── geolocator_android 4.3.1
│ │ │ ├── flutter...
│ │ │ ├── geolocator_platform_interface...
│ │ │ └── uuid...
│ │ ├── geolocator_apple 2.3.7
│ │ │ ├── flutter...
│ │ │ └── geolocator_platform_interface...
│ │ ├── geolocator_platform_interface 4.2.4
│ │ │ ├── flutter...
│ │ │ ├── meta...
│ │ │ ├── plugin_platform_interface...
│ │ │ └── vector_math...
│ │ ├── geolocator_web 2.2.1
│ │ │ ├── flutter...
│ │ │ ├── flutter_web_plugins...
│ │ │ └── geolocator_platform_interface...
│ │ ├── geolocator_windows 0.2.3
│ │ │ ├── flutter...
│ │ │ └── geolocator_platform_interface...
│ │ └── flutter...
│ ├── get_it 7.6.7
│ │ ├── async...
│ │ └── collection...
│ ├── google_fonts 6.1.0
│ │ ├── crypto...
│ │ ├── flutter...
│ │ ├── http...
│ │ └── path_provider...
│ ├── image_picker 1.0.8
│ │ ├── image_picker_android 0.8.9+6
│ │ │ ├── flutter...
│ │ │ ├── flutter_plugin_android_lifecycle...
│ │ │ └── image_picker_platform_interface...
│ │ ├── image_picker_for_web 3.0.2
│ │ │ ├── flutter...
│ │ │ ├── flutter_web_plugins...
│ │ │ ├── image_picker_platform_interface...
│ │ │ └── mime...
│ │ ├── image_picker_ios 0.8.9+1
│ │ │ ├── flutter...
│ │ │ └── image_picker_platform_interface...
│ │ ├── image_picker_linux 0.2.1+1
│ │ │ ├── file_selector_linux 0.9.2+1
│ │ │ │ ├── cross_file...
│ │ │ │ ├── file_selector_platform_interface...
│ │ │ │ └── flutter...
│ │ │ ├── file_selector_platform_interface 2.6.2
│ │ │ │ ├── cross_file...
│ │ │ │ ├── flutter...
│ │ │ │ ├── http...
│ │ │ │ └── plugin_platform_interface...
│ │ │ ├── flutter...
│ │ │ └── image_picker_platform_interface...
│ │ ├── image_picker_macos 0.2.1+1
│ │ │ ├── file_selector_macos 0.9.4
│ │ │ │ ├── cross_file...
│ │ │ │ ├── file_selector_platform_interface...
│ │ │ │ └── flutter...
│ │ │ ├── file_selector_platform_interface...
│ │ │ ├── flutter...
│ │ │ └── image_picker_platform_interface...
│ │ ├── image_picker_platform_interface 2.9.3
│ │ │ ├── cross_file...
│ │ │ ├── flutter...
│ │ │ ├── http...
│ │ │ └── plugin_platform_interface...
│ │ ├── image_picker_windows 0.2.1+1
│ │ │ ├── file_selector_windows 0.9.3+2
│ │ │ │ ├── cross_file...
│ │ │ │ ├── file_selector_platform_interface...
│ │ │ │ └── flutter...
│ │ │ ├── file_selector_platform_interface...
│ │ │ ├── flutter...
│ │ │ └── image_picker_platform_interface...
│ │ └── flutter...
│ ├── internet_connection_checker 1.0.0+1
│ ├── local_session_timeout 3.2.0
│ │ └── flutter...
│ ├── nfc_manager 3.5.0
│ │ └── flutter...
│ ├── open_settings_plus 0.1.0
│ │ ├── flutter...
│ │ └── plugin_platform_interface...
│ ├── package_info_plus 4.2.0
│ │ ├── package_info_plus_platform_interface 2.0.1
│ │ │ ├── flutter...
│ │ │ ├── meta...
│ │ │ └── plugin_platform_interface...
│ │ ├── ffi...
│ │ ├── flutter...
│ │ ├── flutter_web_plugins...
│ │ ├── http...
│ │ ├── meta...
│ │ ├── path...
│ │ └── win32...
│ ├── path_icon 0.7.2
│ │ ├── path_drawing 1.0.1
│ │ │ ├── path_parsing 1.0.1
│ │ │ │ ├── meta...
│ │ │ │ └── vector_math...
│ │ │ ├── flutter...
│ │ │ ├── meta...
│ │ │ └── vector_math...
│ │ ├── flutter...
│ │ ├── vector_math...
│ │ └── xml...
│ ├── path_provider 2.1.4
│ │ ├── path_provider_android 2.2.4
│ │ │ ├── flutter...
│ │ │ └── path_provider_platform_interface...
│ │ ├── path_provider_foundation 2.3.2
│ │ │ ├── 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...
│ │ └── flutter...
│ ├── permission_handler 11.3.1
│ │ ├── permission_handler_android 12.0.12
│ │ │ ├── flutter...
│ │ │ └── permission_handler_platform_interface...
│ │ ├── permission_handler_apple 9.4.5
│ │ │ ├── flutter...
│ │ │ └── permission_handler_platform_interface...
│ │ ├── permission_handler_html 0.1.1
│ │ │ ├── flutter...
│ │ │ ├── flutter_web_plugins...
│ │ │ └── permission_handler_platform_interface...
│ │ ├── permission_handler_platform_interface 4.2.3
│ │ │ ├── flutter...
│ │ │ ├── meta...
│ │ │ └── plugin_platform_interface...
│ │ ├── permission_handler_windows 0.2.1
│ │ │ ├── flutter...
│ │ │ └── permission_handler_platform_interface...
│ │ ├── flutter...
│ │ └── meta...
│ ├── photo_manager 3.3.0
│ │ └── flutter...
│ ├── pro_image_editor 5.4.1
│ │ ├── emoji_picker_flutter 3.1.0
│ │ │ ├── flutter...
│ │ │ ├── flutter_web_plugins...
│ │ │ ├── plugin_platform_interface...
│ │ │ ├── shared_preferences...
│ │ │ └── web...
│ │ ├── image 4.5.2
│ │ │ ├── archive 4.0.2
│ │ │ │ ├── posix 6.0.1
│ │ │ │ │ ├── ffi...
│ │ │ │ │ ├── meta...
│ │ │ │ │ └── path...
│ │ │ │ ├── crypto...
│ │ │ │ └── path...
│ │ │ ├── meta...
│ │ │ └── xml...
│ │ ├── vibration 2.1.0
│ │ │ ├── vibration_platform_interface 0.0.3
│ │ │ │ ├── device_info_plus...
│ │ │ │ ├── flutter...
│ │ │ │ └── plugin_platform_interface...
│ │ │ └── flutter...
│ │ ├── flutter...
│ │ ├── http...
│ │ └── mime...
│ ├── reflectable 4.0.5
│ │ ├── analyzer...
│ │ ├── build...
│ │ ├── build_config...
│ │ ├── build_resolvers...
│ │ ├── build_runner...
│ │ ├── build_runner_core...
│ │ ├── dart_style...
│ │ ├── glob...
│ │ ├── logging...
│ │ ├── package_config...
│ │ ├── path...
│ │ └── source_span...
│ ├── scrollable_positioned_list 0.3.8
│ │ ├── collection...
│ │ └── flutter...
│ ├── shared_preferences 2.3.3
│ │ ├── shared_preferences_android 2.3.2
│ │ │ ├── flutter...
│ │ │ └── shared_preferences_platform_interface...
│ │ ├── shared_preferences_foundation 2.5.4
│ │ │ ├── flutter...
│ │ │ └── shared_preferences_platform_interface...
│ │ ├── shared_preferences_linux 2.4.0
│ │ │ ├── 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.1
│ │ │ ├── flutter...
│ │ │ ├── flutter_web_plugins...
│ │ │ ├── shared_preferences_platform_interface...
│ │ │ └── web...
│ │ ├── shared_preferences_windows 2.4.0
│ │ │ ├── file...
│ │ │ ├── flutter...
│ │ │ ├── path...
│ │ │ ├── path_provider_platform_interface...
│ │ │ ├── path_provider_windows...
│ │ │ └── shared_preferences_platform_interface...
│ │ └── flutter...
│ ├── sqflite 2.3.2
│ │ ├── sqflite_common 2.5.3
│ │ │ ├── meta...
│ │ │ ├── path...
│ │ │ └── synchronized...
│ │ ├── flutter...
│ │ └── path...
│ ├── sqflite_common_ffi 2.3.2+1
│ │ ├── meta...
│ │ ├── path...
│ │ ├── sqflite_common...
│ │ ├── sqlite3...
│ │ └── synchronized...
│ ├── sqlite3 2.4.0
│ │ ├── collection...
│ │ ├── ffi...
│ │ ├── js...
│ │ ├── meta...
│ │ └── path...
│ ├── sqlite3_flutter_libs 0.5.27
│ │ └── flutter...
│ ├── system_settings 2.1.1
│ │ └── flutter...
│ ├── text_scroll 0.2.0
│ │ └── flutter...
│ ├── timezone 0.9.4
│ │ └── path...
│ ├── url_launcher 6.3.0
│ │ ├── url_launcher_android 6.3.2
│ │ │ ├── flutter...
│ │ │ └── url_launcher_platform_interface...
│ │ ├── url_launcher_linux 3.1.1
│ │ │ ├── flutter...
│ │ │ └── url_launcher_platform_interface...
│ │ ├── url_launcher_macos 3.2.0
│ │ │ ├── flutter...
│ │ │ └── url_launcher_platform_interface...
│ │ ├── url_launcher_web 2.3.3
│ │ │ ├── flutter...
│ │ │ ├── flutter_web_plugins...
│ │ │ ├── url_launcher_platform_interface...
│ │ │ └── web...
│ │ ├── url_launcher_windows 3.1.2
│ │ │ ├── flutter...
│ │ │ └── url_launcher_platform_interface...
│ │ ├── flutter...
│ │ ├── url_launcher_ios...
│ │ └── url_launcher_platform_interface...
│ ├── uuid 3.0.7
│ │ └── crypto...
│ ├── xml 6.5.0
│ │ ├── petitparser 6.0.2
│ │ │ └── meta...
│ │ ├── collection...
│ │ └── meta...
│ ├── flutter...
│ ├── flutter_localizations...
│ ├── intl...
│ └── path...
└── url_launcher_ios 6.3.1
├── url_launcher_platform_interface 2.3.2
│ ├── flutter...
│ └── plugin_platform_interface...
└── flutter...

Additional context and comments

No response

@ced1check ced1check added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Feb 20, 2025
@SelaseKay SelaseKay added plugin: messaging platform: ios Issues / PRs which are specifically for iOS. labels Feb 20, 2025
@SelaseKay
Copy link
Contributor

SelaseKay commented Feb 20, 2025

Hi @ced1check, I'm unable to reproduce this still. It works as expected when I test with the firebase_messaging example app. One to note is the arguments for setForegroundNotificationPresentationOptions are false by default so you don't need to explicitly set them to false. You could also reference the example app to see if you're missing something on your end.

@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 Feb 20, 2025
@ced1check
Copy link
Author

@SelaseKay Forgot to mention the example app doesn't request notification permission, so you have to enable those.

Did you check if onMessage is actually being called? Because I confirm it is not called.

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Feb 21, 2025
@SelaseKay
Copy link
Contributor

Hi @ced1check, it does request permission here. Also, I confirmed onMessage is being called.

@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 Feb 21, 2025
@ced1check
Copy link
Author

ced1check commented Feb 21, 2025

I had this in app delegate.swift:

  override func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
    completionHandler([.alert, .badge, .sound])
  }

Removing it appears to solve the issue for foreground messages, however the FirebaseMessaging.onBackgroundMessage is never called when there's both a notification and payload.

And it seems after receiving any background notification, no further notification (message) are handled, whether in foreground or background.

We've already planned switching to payload only messages and handling those ourselves, but this plugin is definitely not working properly on iOS.

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Feb 21, 2025
@SelaseKay
Copy link
Contributor

Hi @ced1check, I just tested again it everything seems to work as expected. How are you sending the notification? Please have a look at the documentation to ensure you're not missing anything.

@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 Feb 21, 2025
@ced1check
Copy link
Author

ced1check commented Feb 21, 2025

@SelaseKay What could I be missing, if I remove the override function mentioned above, I get onMessage called, but then as soon as I receive a background message, no further messages get received, only payload-only are received and are reliable.

If I keep the override function, it is as explained in OP.

@SelaseKay
Copy link
Contributor

Please a share complete sample reproducing this issue. Also, outline clear steps on reproducing this issue as I'm unable to reproduce it on my end.

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: ios Issues / PRs which are specifically for iOS. plugin: messaging type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants