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] MacOS ImageNotification not showing images #5717

Closed
JagandeepBrar opened this issue Apr 10, 2021 · 4 comments
Closed
Labels
platform: macos Issues / PRs which are specifically for MacOS. plugin: messaging type: bug Something isn't working

Comments

@JagandeepBrar
Copy link

JagandeepBrar commented Apr 10, 2021

Bug report

Describe the bug
Following the same steps to add the ImageNotification service extension to my Flutter's macOS application as I did for iOS (where images are working), images are not being shown on macOS (Big Sur, 11.3).

Steps to reproduce

Steps to reproduce the behavior:

  1. Follow the steps here to add the service extension.
  2. Build and notarize the application so notifications work
  3. Send a notification with an image
  4. The notification is received, but the image is nowhere to be seen.

Expected behavior

The image to be shown in the notification. The same message, sent to multiple devices in my backend, shows the image on Android, iOS, but not the macOS instance.


Additional Context

  • Both the Runner target and ImageNotification target have their deployment target set to 10.14
  • Both the Runner target and ImageNotification target have their version and build set to the same value

Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.3, on macOS 11.3 20E5224a darwin-x64, locale en-CA)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.55.1)
[✓] Connected device (1 available)

• No issues found!

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
Dart SDK 2.12.2
Flutter SDK 2.0.3
lunasea 5.0.0+50000014

dependencies:
- badges 1.2.0 [flutter]
- cloud_firestore 1.0.4 [cloud_firestore_platform_interface cloud_firestore_web firebase_core firebase_core_platform_interface flutter meta]
- connectivity_plus 1.0.0 [flutter meta connectivity_plus_platform_interface connectivity_plus_linux connectivity_plus_macos connectivity_plus_web connectivity_plus_windows]
- convert 3.0.0 [typed_data]
- dio 4.0.0 [http_parser path]
- easy_localization 3.0.0 [flutter shared_preferences intl args path easy_logger flutter_localizations]
- encrypt 5.0.0 [args asn1lib clock collection crypto pointycastle]
- expandable 5.0.1 [flutter]
- file_picker 3.0.1 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface]
- firebase_analytics 7.1.1 [firebase_analytics_platform_interface firebase_analytics_web firebase_core flutter meta]
- firebase_auth 1.0.3 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 1.0.3 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 2.0.0 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- firebase_messaging 9.1.1 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- firebase_storage 8.0.3 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter]
- fl_chart 0.35.0 [flutter equatable pedantic]
- flash 1.5.1 [flutter]
- fluro 2.0.3 [flutter]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
- flutter_spinkit 5.0.0 [flutter]
- google_nav_bar 5.0.3 [flutter]
- hive 2.0.2 [meta crypto]
- hive_flutter 1.0.0 [flutter hive path_provider path]
- in_app_purchase 0.5.1+3 [flutter json_annotation meta collection]
- infinite_scroll_pagination 3.0.1 [flutter sliver_tools]
- intl 0.17.0 [clock path]
- modal_bottom_sheet 2.0.0 [flutter]
- network_info_plus 1.0.0 [flutter meta network_info_plus_platform_interface network_info_plus_linux network_info_plus_macos network_info_plus_windows network_info_plus_web]
- package_info_plus 1.0.0 [flutter package_info_plus_platform_interface package_info_plus_linux package_info_plus_macos package_info_plus_windows package_info_plus_web]
- path_provider 2.0.1 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows]
- percent_indicator 3.0.1 [flutter]
- provider 5.0.0 [collection flutter nested]
- quick_actions 0.6.0 [flutter meta quick_actions_platform_interface]
- radarr 2.1.0 [dio json_annotation]
- share 2.0.1 [meta mime flutter]
- sonarr 2.0.0 [dio intl json_annotation meta]
- stack_trace 1.10.0 [path]
- supercharged 2.0.0 [supercharged_dart flutter]
- table_calendar 2.3.3 [flutter intl simple_gesture_detector]
- tautulli 2.0.0 [dio json_annotation]
- tuple 2.0.0 [quiver]
- url_launcher 6.0.3 [flutter url_launcher_platform_interface url_launcher_linux url_launcher_macos url_launcher_windows url_launcher_web]
- uuid 3.0.4 [crypto]
- wake_on_lan 2.0.1+1 [convert]
- xml 5.1.0 [collection meta petitparser]

dev dependencies:
- build_runner 1.12.2 [args async build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style glob graphs http_multi_server io js logging meta mime path pedantic pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml]
- flutter_launcher_icons 0.9.0 [args image path yaml]
- flutter_native_splash 1.1.7+1 [image meta path xml yaml]
- hive_generator 1.0.1 [build source_gen hive analyzer]

transitive dependencies:
- _fe_analyzer_shared 20.0.0 [meta]
- analyzer 1.4.0 [_fe_analyzer_shared cli_util collection convert crypto glob meta package_config path pub_semver source_span watcher yaml pedantic]
- archive 3.1.2 [crypto path]
- args 2.0.0
- asn1lib 1.0.0
- async 2.5.0 [collection]
- build 2.0.0 [analyzer async convert crypto glob logging meta path]
- build_config 0.4.7 [checked_yaml json_annotation meta path pubspec_parse yaml]
- build_daemon 2.1.10 [built_collection built_value http_multi_server logging pedantic path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.0.0 [analyzer build crypto graphs logging path package_config pool pub_semver stream_transform]
- build_runner_core 6.1.12 [async build build_config build_resolvers collection convert crypto glob graphs logging meta path package_config pedantic pool timing watcher yaml]
- built_collection 5.0.0
- built_value 8.0.4 [built_collection collection fixnum]
- characters 1.1.0
- charcode 1.2.0
- checked_yaml 2.0.1 [json_annotation source_span yaml]
- cli_util 0.3.0 [meta path]
- clock 1.1.0
- cloud_firestore_platform_interface 4.0.1 [collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 1.0.4 [cloud_firestore_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js]
- code_builder 3.7.0 [built_collection built_value collection matcher meta]
- collection 1.15.0
- connectivity_plus_linux 1.0.0 [flutter connectivity_plus_platform_interface dbus meta]
- connectivity_plus_macos 1.0.0 [connectivity_plus_platform_interface flutter]
- connectivity_plus_platform_interface 1.0.0 [flutter meta plugin_platform_interface]
- connectivity_plus_web 1.0.0 [connectivity_plus_platform_interface flutter_web_plugins flutter]
- connectivity_plus_windows 1.0.0 [connectivity_plus_platform_interface flutter]
- crypto 3.0.1 [collection typed_data]
- dart_style 2.0.0 [analyzer args path pub_semver source_span]
- dbus 0.2.5 [args meta pedantic xml]
- easy_logger 0.0.2 [flutter]
- equatable 2.0.0 [collection meta]
- ffi 1.0.0
- file 6.1.0 [meta path]
- firebase 9.0.1 [http http_parser js]
- firebase_analytics_platform_interface 1.1.0 [flutter meta]
- firebase_analytics_web 0.2.0+1 [firebase firebase_analytics_platform_interface flutter flutter_web_plugins meta]
- firebase_auth_platform_interface 4.0.2 [firebase_core flutter meta plugin_platform_interface]
- firebase_auth_web 1.0.5 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta]
- firebase_core_platform_interface 4.0.0 [flutter meta plugin_platform_interface]
- firebase_core_web 1.0.2 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_crashlytics_platform_interface 3.0.0 [collection firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_platform_interface 2.1.1 [firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 1.0.4 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta]
- firebase_storage_platform_interface 2.0.1 [collection firebase_core flutter meta plugin_platform_interface]
- firebase_storage_web 1.0.3 [async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta]
- fixnum 1.0.0
- flutter_localizations 0.0.0 [flutter intl characters clock collection meta path typed_data vector_math]
- flutter_plugin_android_lifecycle 2.0.1 [flutter]
- flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math]
- glob 2.0.1 [async collection file path pedantic string_scanner]
- graphs 1.0.0
- http 0.13.1 [http_parser meta path pedantic]
- http_multi_server 3.0.0 [async]
- http_parser 4.0.0 [charcode collection source_span string_scanner typed_data]
- image 3.0.2 [archive meta xml]
- io 1.0.0 [meta path string_scanner]
- js 0.6.3
- json_annotation 4.0.1
- logging 1.0.1
- matcher 0.12.10 [stack_trace]
- meta 1.3.0
- mime 1.0.0
- nested 1.0.0 [flutter]
- network_info_plus_linux 1.0.0 [flutter network_info_plus_platform_interface dbus meta]
- network_info_plus_macos 1.0.0 [network_info_plus_platform_interface flutter]
- network_info_plus_platform_interface 1.0.0 [flutter meta plugin_platform_interface]
- network_info_plus_web 1.0.0 [flutter flutter_web_plugins network_info_plus_platform_interface]
- network_info_plus_windows 1.0.0 [flutter network_info_plus_platform_interface]
- package_config 2.0.0 [path]
- package_info_plus_linux 1.0.0 [package_info_plus_platform_interface flutter path]
- package_info_plus_macos 1.0.0 [flutter]
- package_info_plus_platform_interface 1.0.0 [flutter meta plugin_platform_interface]
- package_info_plus_web 1.0.0 [http package_info_plus_platform_interface flutter flutter_web_plugins meta]
- package_info_plus_windows 1.0.0 [package_info_plus_platform_interface ffi flutter win32]
- path 1.8.0
- path_provider_linux 2.0.0 [path xdg_directories path_provider_platform_interface flutter]
- path_provider_macos 2.0.0 [flutter]
- path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface]
- path_provider_windows 2.0.0 [path_provider_platform_interface meta path flutter ffi win32]
- pedantic 1.11.0
- petitparser 4.1.0 [meta]
- platform 3.0.0
- plugin_platform_interface 2.0.0 [meta]
- pointycastle 3.0.1 [collection]
- pool 1.5.0 [async stack_trace]
- process 4.2.1 [file path platform]
- pub_semver 2.0.0 [collection]
- pubspec_parse 1.0.0 [checked_yaml collection json_annotation pub_semver yaml]
- quick_actions_platform_interface 1.0.0 [flutter meta plugin_platform_interface]
- quiver 3.0.1 [matcher]
- shared_preferences 2.0.5 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows]
- shared_preferences_linux 2.0.0 [flutter file meta path path_provider_linux shared_preferences_platform_interface]
- shared_preferences_macos 2.0.0 [shared_preferences_platform_interface flutter]
- shared_preferences_platform_interface 2.0.0 [flutter]
- shared_preferences_web 2.0.0 [shared_preferences_platform_interface flutter flutter_web_plugins meta]
- shared_preferences_windows 2.0.0 [shared_preferences_platform_interface flutter file meta path path_provider_platform_interface path_provider_windows]
- shelf 1.1.0 [async collection http_parser path stack_trace stream_channel]
- shelf_web_socket 1.0.1 [shelf stream_channel web_socket_channel]
- simple_gesture_detector 0.1.6 [flutter]
- sky_engine 0.0.99
- sliver_tools 0.2.1 [flutter]
- source_gen 1.0.0 [analyzer async build dart_style glob meta path pedantic source_span]
- source_span 1.8.1 [collection path term_glyph]
- stream_channel 2.1.0 [async]
- stream_transform 2.0.0
- string_scanner 1.1.0 [charcode source_span]
- supercharged_dart 2.0.0
- term_glyph 1.2.0
- timing 1.0.0 [json_annotation]
- typed_data 1.3.0 [collection]
- url_launcher_linux 2.0.0 [flutter]
- url_launcher_macos 2.0.0 [flutter]
- url_launcher_platform_interface 2.0.2 [flutter plugin_platform_interface]
- url_launcher_web 2.0.0 [url_launcher_platform_interface meta flutter flutter_web_plugins]
- url_launcher_windows 2.0.0 [flutter]
- vector_math 2.1.0
- watcher 1.0.0 [async path pedantic]
- web_socket_channel 2.0.0 [async crypto stream_channel]
- win32 2.0.5 [ffi]
- xdg_directories 0.2.0 [meta path process]
- yaml 3.1.0 [collection source_span string_scanner]

@JagandeepBrar JagandeepBrar added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Apr 10, 2021
@markusaksli-nc
Copy link
Contributor

I'm successfully sending notifications to macOS but not actually seeing them anywhere. Are you seeing regular notifications and just missing the images?

@markusaksli-nc markusaksli-nc added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Apr 14, 2021
@JagandeepBrar
Copy link
Author

JagandeepBrar commented Apr 14, 2021

Are you seeing regular notifications and just missing the images?

Yes, I am successfully receiving regular notifications, but only when the application is built for release, hardened, and notarized by Apple. Any other builds (debug, profile, release without notarization) do not show notifications (but I do get the permission request notification).

@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 Apr 14, 2021
@markusaksli-nc
Copy link
Contributor

markusaksli-nc commented Apr 19, 2021

Was able to reproduce this with a notarized build of the official example using

  firebase_core: ^1.0.3
  firebase_messaging: ^9.1.1
  flutter_local_notifications: ^5.0.0+1
  http: ^0.13.1
flutter doctor -v
[✓] Flutter (Channel master, 2.2.0-11.0.pre.103, on macOS 11.2.3 20D91
    darwin-arm, locale en-GB)
    • Flutter version 2.2.0-11.0.pre.103 at
      /Users/nevercode/development/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f0c9710493 (5 days ago), 2021-04-13 20:29:40 -0500
    • Engine revision 04cd0db032
    • Dart version 2.13.0 (build 2.13.0-232.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/nevercode/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Users/nevercode/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7199119/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Users/nevercode/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7199119/Android
      Studio.app/Contents
    • Flutter plugin can be installed from:
      � https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      � https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)

[✓] Connected device (3 available)
    • Nevercode’s iPhone (mobile) • b668e524315069f3db3661ac11ff1f66afafebdb •
      ios            • iOS 14.4.2
    • macOS (desktop)             • macos                                    •
      darwin-arm64   • macOS 11.2.3 20D91 darwin-arm
    • Chrome (web)                • chrome                                   •
      web-javascript • Google Chrome 89.0.4389.128

• No issues found!

Notifications show up but no images. Also, it seems like the official example just crashes because of flutter_local_notifications every time a notification is received.

Logs
Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [30532]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   org.cocoapods.flutter-local-notifications	0x0000000108c66842 Swift runtime failure: Unexpectedly found nil while unwrapping an Optional value + 0 (FlutterLocalNotificationsPlugin.swift:88) [inlined]
1   org.cocoapods.flutter-local-notifications	0x0000000108c66842 specialized FlutterLocalNotificationsPlugin.userNotificationCenter(_:willPresent:withCompletionHandler:) + 1250 (FlutterLocalNotificationsPlugin.swift:88)
2   org.cocoapods.flutter-local-notifications	0x0000000108c60cc7 specialized FlutterLocalNotificationsPlugin.userNotificationCenter(_:willPresent:withCompletionHandler:) + 11 [inlined]
3   org.cocoapods.flutter-local-notifications	0x0000000108c60cc7 @objc FlutterLocalNotificationsPlugin.userNotificationCenter(_:willPresent:withCompletionHandler:) + 87 (<compiler-generated>:86)
4   com.nevercode.triage          	0x00000001005a2b66 -[FLTFirebaseMessagingPlugin userNotificationCenter:willPresentNotification:withCompletionHandler:] + 877 (FLTFirebaseMessagingPlugin.m:299)
5   org.cocoapods.FirebaseMessaging	0x0000000108ab56f8 FCMSwizzleWillPresentNotificationWithHandler + 503
6   com.apple.UserNotifications   	0x00007fff2a538d43 __74-[UNUserNotificationCenter willPresentNotification:withCompletionHandler:]_block_invoke + 105
7   libdispatch.dylib             	0x00007fff201855dd _dispatch_call_block_and_release + 12
8   libdispatch.dylib             	0x00007fff201867c7 _dispatch_client_callout + 8
9   libdispatch.dylib             	0x00007fff20192b86 _dispatch_main_queue_callback_4CF + 940
10  com.apple.CoreFoundation      	0x00007fff20467356 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
11  com.apple.CoreFoundation      	0x00007fff20429188 __CFRunLoopRun + 2745
12  com.apple.CoreFoundation      	0x00007fff20427fe2 CFRunLoopRunSpecific + 567
13  com.apple.HIToolbox           	0x00007fff288f6630 RunCurrentEventLoopInMode + 292
14  com.apple.HIToolbox           	0x00007fff288f642c ReceiveNextEventCommon + 709
15  com.apple.HIToolbox           	0x00007fff288f614f _BlockUntilNextEventMatchingListInModeWithFilter + 64
16  com.apple.AppKit              	0x00007fff22b7d9b1 _DPSNextEvent + 883
17  com.apple.AppKit              	0x00007fff22b7c177 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1366
18  com.apple.AppKit              	0x00007fff22b6e68a -[NSApplication run] + 586
19  com.apple.AppKit              	0x00007fff22b4296f NSApplicationMain + 816
20  com.nevercode.triage          	0x000000010059e999 main + 9 (AppDelegate.swift:5)
21  libdyld.dylib                 	0x00007fff2034d621 start + 1

@markusaksli-nc markusaksli-nc added plugin: messaging and removed Needs Attention This issue needs maintainer attention. labels Apr 19, 2021
@darshankawar darshankawar added the platform: macos Issues / PRs which are specifically for MacOS. label Jun 29, 2022
@Lyokone
Copy link
Contributor

Lyokone commented Nov 24, 2023

Hello 👋 I'm not sure if this is still an issue, but you should use flutter_local_notifications to handle loading images directly. You can handle that by using silent notifications on macos and using FLN to display the received notification

@Lyokone Lyokone closed this as completed Nov 24, 2023
@firebase firebase locked and limited conversation to collaborators Dec 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: macos Issues / PRs which are specifically for MacOS. plugin: messaging type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants