From 263997f6facb9968a916c98dde21059192aa0407 Mon Sep 17 00:00:00 2001 From: TheOneWithTheBraid Date: Wed, 14 Dec 2022 14:38:32 +0100 Subject: [PATCH] feat: support Android notification channels Signed-off-by: TheOneWithTheBraid --- lib/utils/push_helper.dart | 24 ++++++++++++-------- linux/flutter/generated_plugin_registrant.cc | 4 ++++ linux/flutter/generated_plugins.cmake | 1 + pubspec.lock | 11 +++++++-- pubspec.yaml | 4 ++-- 5 files changed, 30 insertions(+), 14 deletions(-) diff --git a/lib/utils/push_helper.dart b/lib/utils/push_helper.dart index 3409bb24..da26aa69 100644 --- a/lib/utils/push_helper.dart +++ b/lib/utils/push_helper.dart @@ -48,16 +48,20 @@ Future pushHelper( l10n?.newMessageInFluffyChat, l10n?.openAppToReadMessages, NotificationDetails( - iOS: const DarwinNotificationDetails(), - android: AndroidNotificationDetails( - AppConfig.pushNotificationsChannelId, - AppConfig.pushNotificationsChannelName, - channelDescription: AppConfig.pushNotificationsChannelDescription, - number: notification.counts?.unread, - ticker: l10n!.unreadChats(notification.counts?.unread ?? 1), - importance: Importance.max, - priority: Priority.high, - )), + iOS: const DarwinNotificationDetails(), + android: AndroidNotificationDetails( + notification.roomId ?? AppConfig.pushNotificationsChannelId, + notification.roomName ?? AppConfig.pushNotificationsChannelName, + channelDescription: notification.roomName ?? + AppConfig.pushNotificationsChannelDescription, + groupAlertBehavior: GroupAlertBehavior.summary, + category: AndroidNotificationCategory.message, + number: notification.counts?.unread, + ticker: l10n!.unreadChats(notification.counts?.unread ?? 1), + importance: Importance.max, + priority: Priority.high, + ), + ), ); rethrow; } diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 14d91e18..6badfc51 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -31,6 +32,9 @@ void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); + g_autoptr(FlPluginRegistrar) flutter_webrtc_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterWebRTCPlugin"); + flutter_web_r_t_c_plugin_register_with_registrar(flutter_webrtc_registrar); g_autoptr(FlPluginRegistrar) handy_window_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "HandyWindowPlugin"); handy_window_plugin_register_with_registrar(handy_window_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 820f9381..6ec24fd0 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -8,6 +8,7 @@ list(APPEND FLUTTER_PLUGIN_LIST emoji_picker_flutter file_selector_linux flutter_secure_storage_linux + flutter_webrtc handy_window record_linux url_launcher_linux diff --git a/pubspec.lock b/pubspec.lock index aca1c084..8a1e61c7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -273,7 +273,7 @@ packages: name: dart_webrtc url: "https://pub.dartlang.org" source: hosted - version: "1.0.11" + version: "1.0.12" dbus: dependency: transitive description: @@ -685,7 +685,7 @@ packages: name: flutter_webrtc url: "https://pub.dartlang.org" source: hosted - version: "0.9.14" + version: "0.9.18" fuchsia_remote_debug_protocol: dependency: transitive description: flutter @@ -1230,6 +1230,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.1.0" + platform_detect: + dependency: transitive + description: + name: platform_detect + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" plugin_platform_interface: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 1492c3a2..6751123c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -47,7 +47,7 @@ dependencies: flutter_secure_storage: ^6.0.0 flutter_typeahead: ^4.0.0 flutter_web_auth: ^0.5.0 - flutter_webrtc: 0.9.14 # Pinned because >0.9.14 add Linux support which lets build fail + flutter_webrtc: ^0.9.18 future_loading_dialog: ^0.2.3 geolocator: ^7.6.2 handy_window: ^0.1.6 @@ -89,7 +89,7 @@ dependencies: video_player: ^2.2.18 vrouter: ^1.2.0+21 wakelock: ^0.6.1+1 - webrtc_interface: ^1.0.8 + webrtc_interface: ^1.0.10 dev_dependencies: dart_code_metrics: ^4.10.1