From bd1f0a455cb5a26279ded1dd9ca8a0351f3aa36e Mon Sep 17 00:00:00 2001 From: Thomas Galliker <> Date: Fri, 6 Jun 2025 08:24:29 +0200 Subject: [PATCH 01/54] Bump version to 3.3 --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bf58d10..e1cb8f8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,7 +26,7 @@ variables: buildPlatform: 'Any CPU' buildConfiguration: 'Release' majorVersion: 3 - minorVersion: 2 + minorVersion: 3 patchVersion: $[counter(format('{0}.{1}', variables.majorVersion, variables.minorVersion), 0)] ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}: # Versioning: 1.0.0 From 7b0c8fbf0af1698c59d6b6c48079429cf71545af Mon Sep 17 00:00:00 2001 From: Thomas Galliker <> Date: Fri, 6 Jun 2025 08:24:38 +0200 Subject: [PATCH 02/54] Update release notes --- .../Plugin.FirebasePushNotifications.csproj | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Plugin.FirebasePushNotifications/Plugin.FirebasePushNotifications.csproj b/Plugin.FirebasePushNotifications/Plugin.FirebasePushNotifications.csproj index 7a5359c..6d5e501 100644 --- a/Plugin.FirebasePushNotifications/Plugin.FirebasePushNotifications.csproj +++ b/Plugin.FirebasePushNotifications/Plugin.FirebasePushNotifications.csproj @@ -37,7 +37,14 @@ https://github.com/thomasgalliker/Plugin.FirebasePushNotifications superdev GmbH false - 3.1 + 3.3 +- Bug fixes and refactorings. + +3.2 +- Improved default notification channel handling. +- Bug fixes and refactorings. + +3.1 - Extend INotificationChannels to manage notification channel groups. - Internal refactoring of INotificationChannels implementation. - Removed properties IsActive and IsDefault from NotificationChannelRequest. Set the default notification channel via UseFirebasePushNotifications(o => o.Android.DefaultNotificationChannelId = ...). @@ -104,6 +111,6 @@ - + From 3789176b5fe0fc8f68572db1d0528ff9b19f73ac Mon Sep 17 00:00:00 2001 From: Thomas Galliker <> Date: Fri, 6 Jun 2025 08:24:48 +0200 Subject: [PATCH 03/54] Extend log message --- .../Platforms/Android/NotificationBuilder.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Plugin.FirebasePushNotifications/Platforms/Android/NotificationBuilder.cs b/Plugin.FirebasePushNotifications/Platforms/Android/NotificationBuilder.cs index 88b0941..d45ad68 100644 --- a/Plugin.FirebasePushNotifications/Platforms/Android/NotificationBuilder.cs +++ b/Plugin.FirebasePushNotifications/Platforms/Android/NotificationBuilder.cs @@ -192,7 +192,8 @@ public virtual void OnNotificationReceived(IDictionary data) { this.logger.LogError( $"NotificationCompat.Builder requires a notification channel to work properly. " + - $"Use {nameof(INotificationChannels)}.{nameof(INotificationChannels.CreateNotificationChannels)} " + + $"Use {nameof(INotificationChannels)}.{nameof(INotificationChannels.CreateNotificationChannels)} or " + + $"{nameof(INotificationChannels)}.{nameof(INotificationChannels.SetNotificationChannels)} " + $"to create at least one notification channel."); return; } From e92ab6b8d90a882c0ba6ee30ded324ee477f561a Mon Sep 17 00:00:00 2001 From: Thomas Galliker <> Date: Fri, 6 Jun 2025 08:33:41 +0200 Subject: [PATCH 04/54] Reformat log message + log missing default notification channel as warning --- .../Android/Channels/NotificationChannels.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Plugin.FirebasePushNotifications/Platforms/Android/Channels/NotificationChannels.cs b/Plugin.FirebasePushNotifications/Platforms/Android/Channels/NotificationChannels.cs index f54d360..c0653df 100644 --- a/Plugin.FirebasePushNotifications/Platforms/Android/Channels/NotificationChannels.cs +++ b/Plugin.FirebasePushNotifications/Platforms/Android/Channels/NotificationChannels.cs @@ -194,6 +194,8 @@ public void SetNotificationChannels([NotNull] NotificationChannelRequest[] notif return; } + // If no default notification channel is requested, + // we create a default notification channel with some predefined properties. if (!notificationChannelRequests.Any(c => c.IsDefault)) { var metadata = MetadataHelper.GetMetadata(); @@ -205,18 +207,20 @@ public void SetNotificationChannels([NotNull] NotificationChannelRequest[] notif { ChannelId = channelId, ChannelName = Constants.DefaultNotificationChannelName, + IsDefault = true, LockscreenVisibility = NotificationVisibility.Public, - Importance = this.options.Android.DefaultNotificationImportance, - IsDefault = true + Importance = this.options.Android.DefaultNotificationImportance }; const string optionsPath = $"options.{nameof(FirebasePushNotificationOptions.Android)}." + $"{nameof(FirebasePushNotificationAndroidOptions.NotificationChannels)}"; - this.logger.LogDebug( - $"No default notification channel specified in {optionsPath}. Creating default notification channel with {Environment.NewLine}" + + this.logger.LogWarning( + $"Missing default notification channel (IsDefault=true) in {optionsPath}. " + + $"A default notification channel will be created with the following properties: {Environment.NewLine}" + $"> ChannelId={defaultNotificationChannelRequest.ChannelId}, {Environment.NewLine}" + $"> ChannelName={defaultNotificationChannelRequest.ChannelName}, {Environment.NewLine}" + + $"> IsDefault={defaultNotificationChannelRequest.IsDefault}, {Environment.NewLine}" + $"> LockscreenVisibility={defaultNotificationChannelRequest.LockscreenVisibility}, {Environment.NewLine}" + $"> Importance={defaultNotificationChannelRequest.Importance}"); From b635ccb5cb89a70a403649f78d2ae82596d7dfd3 Mon Sep 17 00:00:00 2001 From: Thomas Galliker <> Date: Fri, 6 Jun 2025 12:22:09 +0200 Subject: [PATCH 05/54] Display "IsDefault" in sample app --- .../NotificationChannelViewModel.cs | 7 +++-- .../NotificationChannelItemTemplate.xaml | 29 +++++++++++++------ 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/Samples/MauiSampleApp/ViewModels/NotificationChannelViewModel.cs b/Samples/MauiSampleApp/ViewModels/NotificationChannelViewModel.cs index 043fc02..58f0663 100644 --- a/Samples/MauiSampleApp/ViewModels/NotificationChannelViewModel.cs +++ b/Samples/MauiSampleApp/ViewModels/NotificationChannelViewModel.cs @@ -34,10 +34,11 @@ public NotificationChannelViewModel( { this.ChannelId = notificationChannel.Id; this.ChannelName = notificationChannel.Name; + this.IsDefault = notificationChannel.Id == NotificationChannels.Current.Channels.DefaultNotificationChannelId; this.Description = notificationChannel.Description; - this.LockscreenVisibility = Enum.GetName(notificationChannel.LockscreenVisibility) ?? $"{notificationChannel.LockscreenVisibility}"; + this.LockscreenVisibility = Enum.GetName(typeof(NotificationVisibility), notificationChannel.LockscreenVisibility) ?? $"{notificationChannel.LockscreenVisibility}"; this.Group = notificationChannel.Group ?? "null"; - this.Importance = Enum.GetName(notificationChannel.Importance); + this.Importance = Enum.GetName(typeof(NotificationImportance), notificationChannel.Importance); this.logger = logger; this.dialogService = dialogService; @@ -49,6 +50,8 @@ public NotificationChannelViewModel( public string ChannelName { get; } + public bool IsDefault { get; } + public string Description { get; } public string LockscreenVisibility { get; } diff --git a/Samples/MauiSampleApp/Views/ItemTemplates/NotificationChannelItemTemplate.xaml b/Samples/MauiSampleApp/Views/ItemTemplates/NotificationChannelItemTemplate.xaml index 587e247..d0e92d1 100644 --- a/Samples/MauiSampleApp/Views/ItemTemplates/NotificationChannelItemTemplate.xaml +++ b/Samples/MauiSampleApp/Views/ItemTemplates/NotificationChannelItemTemplate.xaml @@ -9,7 +9,7 @@ + RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto">