Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Plugin.FirebasePushNotifications.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
azure-pipelines.yml = azure-pipelines.yml
LICENSE = LICENSE
README.md = README.md
ReleaseNotes.txt = ReleaseNotes.txt
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plugin.FirebasePushNotifications", "Plugin.FirebasePushNotifications\Plugin.FirebasePushNotifications.csproj", "{49F1F62D-5A20-49A6-B508-408BE32B0DC6}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void ProcessIntent(Activity activity, Intent intent)
if (!intent.GetBooleanExtra(intentAlreadyHandledKey, false))
{
intent.PutExtra(intentAlreadyHandledKey, true);
this.logger.LogDebug($"ProcessIntent: {intentAlreadyHandledKey} not present --> Process notification");
this.logger.LogDebug($"ProcessIntent: {intentAlreadyHandledKey} not present Process notification");

if (extras.TryGetInt(Constants.ActionNotificationIdKey, out var notificationId))
{
Expand Down Expand Up @@ -216,7 +216,7 @@ public void ProcessIntent(Activity activity, Intent intent)
}
else
{
this.logger.LogDebug($"ProcessIntent: {intentAlreadyHandledKey} is present --> Notification already processed");
this.logger.LogDebug($"ProcessIntent: {intentAlreadyHandledKey} is present Notification already processed");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<linker>
<assembly fullname="Plugin.FirebasePushNotifications"/>
</linker>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-dontwarn com.google.android.gms.**
-keep class com.google.android.gms.** { *; }
-keep class com.google.firebase.** { *; }
-keep class androidx.startup.AppInitializer
-keep class androidx.startup.InitializationProvider
-keep class androidx.startup.Initializer
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net7.0-android33.0;net7.0-ios;net8.0;net8.0-android34.0;net8.0-ios17.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android34.0;net8.0-ios17.0;net9.0;net9.0-android35.0;net9.0-ios18.0</TargetFrameworks>
<OutputType>Library</OutputType>
<UseMaui>true</UseMaui>
<MauiVersion Condition="$(TargetFramework.Contains('net8.0'))">8.0.3</MauiVersion>
<MauiVersion Condition="$(TargetFramework.Contains('net7.0'))">7.0.49</MauiVersion>
<MauiVersion Condition="$(TargetFramework.Contains('net9.0'))">9.0.0</MauiVersion>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<IsPackable>true</IsPackable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">12.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' and $(TargetFramework.Contains('net8.0'))">12.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' and $(TargetFramework.Contains('net9.0'))">12.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>

<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
Expand All @@ -32,60 +32,18 @@
<PackageTags>firebase;push;notification;notifications</PackageTags>
<PackageIcon>logo.png</PackageIcon>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageProjectUrl>https://github.com/thomasgalliker/Plugin.FirebasePushNotifications</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/thomasgalliker/Plugin.FirebasePushNotifications</RepositoryUrl>
<Company>superdev GmbH</Company>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageReleaseNotes>4.0
- Improved notification channel handling during app startup.
- Data-only notifications are no longer displayed in the notification tray.
- NotificationBuilder support for Android API 26 and below (where no notification channels are available).
- OpenNotificationSettings now also works for Android API 26 and below.
- Synchronized notification handling behavior between Android and iOS.
- Renamed topic methods to follow the Async pattern: SubscribeToTopicAsync, UnsubscribeFromTopicAsync, etc.
- Use AddOnCompleteListener for asynchronous tasks in Android.
- 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 = ...).
- Configure initial list of notification channels via o.Android.NotificationChannels and notification groups via o.Android.NotificationChannelGroups.

3.0
- Update firebase-ios-sdk by replacing nuget package Xamarin.Firebase.iOS.CloudMessaging with AdamE.Firebase.iOS.CloudMessaging.

2.5
- Move static properties from Android's FirebasePushNotificationManager to FirebasePushNotificationAndroidOptions.
- iOS 18 workaround for duplicate notifications in foreground mode.
- iOS options to override default UNNotificationPresentationOptions for notifications received in foreground mode.
- Handle gcm.notification.click_action payload as click_action in Android.

2.4
- Refactor instanciation of IFirebasePushNotification.
- Refactor startup procedure of platform-specific services.
- Add singleton instance INotificationPermissions.Current.

2.3
- General bug fixes and code cleanup.
- Bug fixes in the area of topic subscriptions.
- IFirebasePushNotification.Current.
- Add singleton instance IFirebasePushNotification.Current and INotificationPermissions.Current.

2.2
- Complete refactoring of the original 1.x implementation.
- Simplified APIs, less static code, support for dependency injection.

1.0
- Initial release.
</PackageReleaseNotes>
<Copyright>Copyright $([System.DateTime]::Now.ToString(`yyyy`)) © Thomas Galliker</Copyright>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Copyright>Copyright $([System.DateTime]::Now.ToString(`yyyy`)) © Thomas Galliker</Copyright>
<PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/../ReleaseNotes.txt"))</PackageReleaseNotes>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedAllSources>true</EmbedAllSources>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

<ItemGroup>
Expand All @@ -94,30 +52,37 @@
<None Include="..\Images\logo.png" Pack="True" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="[13.0.3,)" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.Contains('net7.0'))">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="[7.0.0,)" />
</ItemGroup>


<ItemGroup Condition="$(TargetFramework.Contains('net8.0'))">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="[8.0.0,)" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.Contains('net9.0'))">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="[9.0.0,)" />
</ItemGroup>

<!--Platform-specific package references-->
<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
<PackageReference Include="Xamarin.Firebase.Messaging" Version="123.1.2.2" />
<PackageReference Include="Xamarin.Firebase.Common" Version="120.3.3.1" />
<PackageReference Include="Xamarin.GooglePlayServices.Tasks" Version="118.0.2.3" />

<!--Temporary workaround for issue in AndroidX: https://github.com/xamarin/AndroidX/issues/742-->
<PackageReference Include="Xamarin.AndroidX.Activity" Version="1.7.2.1" />
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.7.2.1" />
<PackageReference Include="Xamarin.Firebase.Messaging" Version="124.1.1.2" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.Contains('-ios'))">
<PackageReference Include="AdamE.Firebase.iOS.CloudMessaging" Version="11.10.0" />
<PackageReference Include="AdamE.Firebase.iOS.CloudMessaging" Version="[11.10.0,)" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
<ProguardConfiguration Include="Platforms\Android\proguard.cfg" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
<TrimmerRootDescriptor Include="ILLink.Descriptors.xml" RootMode="All" />
<EmbeddedResource Include="Platforms\Android\ILLink.Descriptors.xml" LogicalName="ILLink.Descriptors.xml" />
</ItemGroup>
</Project>
48 changes: 48 additions & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
4.0
- Improved notification channel handling during app startup.
- Data-only notifications are no longer displayed in the notification tray.
- NotificationBuilder support for Android API 26 and below (where no notification channels are available).
- OpenNotificationSettings now also works for Android API 26 and below.
- Synchronized notification handling behavior between Android and iOS.
- Renamed topic methods to follow the Async pattern: SubscribeToTopicAsync, UnsubscribeFromTopicAsync, etc.
- Use AddOnCompleteListener for asynchronous tasks in Android.
- Add target framework net9.0, net9.0-android and net9.0-ios.
- Remove target framework net7.0, net7.0-android and net7.0-ios.
- 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 = ...).
- Configure initial list of notification channels via o.Android.NotificationChannels and notification groups via o.Android.NotificationChannelGroups.

3.0
- Update firebase-ios-sdk by replacing nuget package Xamarin.Firebase.iOS.CloudMessaging with AdamE.Firebase.iOS.CloudMessaging.

2.5
- Move static properties from Android's FirebasePushNotificationManager to FirebasePushNotificationAndroidOptions.
- iOS 18 workaround for duplicate notifications in foreground mode.
- iOS options to override default UNNotificationPresentationOptions for notifications received in foreground mode.
- Handle gcm.notification.click_action payload as click_action in Android.

2.4
- Refactor instanciation of IFirebasePushNotification.
- Refactor startup procedure of platform-specific services.
- Add singleton instance INotificationPermissions.Current.

2.3
- General bug fixes and code cleanup.
- Bug fixes in the area of topic subscriptions.
- IFirebasePushNotification.Current.
- Add singleton instance IFirebasePushNotification.Current and INotificationPermissions.Current.

2.2
- Complete refactoring of the original 1.x implementation.
- Simplified APIs, less static code, support for dependency injection.

1.0
- Initial release.
2 changes: 2 additions & 0 deletions Samples/MauiSampleApp/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Plugin.FirebasePushNotifications.Model.Queues;
using MauiSampleApp.Services.Logging;
using NLog.Extensions.Logging;
using Superdev.Maui;

#if ANDROID
using Android.App;
Expand Down Expand Up @@ -66,6 +67,7 @@ public static MauiApp CreateMauiApp()
// o.iOS.iOS18Workaround.Enable = true;
#endif
})
.UseSuperdevMaui()
.ConfigureFonts(fonts =>
{
fonts.AddFont("IBMPlexSans-Regular.ttf", "IBMPlexSans");
Expand Down
27 changes: 11 additions & 16 deletions Samples/MauiSampleApp/MauiSampleApp.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios</TargetFrameworks>
<TargetFrameworks>net9.0-android;net9.0-ios</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>MauiSampleApp</RootNamespace>
<UseMaui>true</UseMaui>
<MauiVersion>8.0.100</MauiVersion>
<MauiVersion>9.0.90</MauiVersion>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
Expand All @@ -19,18 +19,13 @@
<ApplicationIdGuid>da8d1bd2-3ced-4171-b0da-3f1a7806e5af</ApplicationIdGuid>

<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationDisplayVersion>1.0.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">12.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">12.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
</PropertyGroup>

<PropertyGroup Condition=" $(TargetFramework.StartsWith('net')) == true AND $(TargetFramework.EndsWith('.0')) == true AND $(TargetFramework.Contains('-')) != true ">
<!-- In order to use this project as a test target, we mark it as OutputType=Library -->
<OutputType>Library</OutputType>
</PropertyGroup>

<ItemGroup>
<!-- App Icon -->
<MauiIcon
Expand Down Expand Up @@ -82,7 +77,7 @@
<AndroidLinkMode>None</AndroidLinkMode>
<AndroidPackageFormat>apk</AndroidPackageFormat>
<AndroidCreatePackagePerAbi>false</AndroidCreatePackagePerAbi>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<EmbedAssembliesIntoApk>false</EmbedAssembliesIntoApk>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.Contains('-android')) and '$(Configuration)' == 'Release'">
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
Expand Down Expand Up @@ -134,12 +129,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="9.0.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.15" />
<PackageReference Include="Sentry.Maui" Version="5.0.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="12.1.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.7" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.5.0" />
<PackageReference Include="Sentry.Maui" Version="5.10.0" />
<PackageReference Include="Superdev.Maui" Version="1.0.107-pre" />
<PackageReference Include="ValueConverters.MAUI" Version="3.1.22" />

<!--To avoid silly build errors... incredible!-->
Expand Down
4 changes: 0 additions & 4 deletions Samples/MauiSampleApp/Platforms/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>

<queries>
<intent>
<action android:name="android.media.action.IMAGE_CAPTURE"/>
Expand Down
4 changes: 2 additions & 2 deletions Samples/MauiSampleApp/Views/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:b="clr-namespace:Superdev.Maui.Behaviors;assembly=Superdev.Maui"
xmlns:controls="clr-namespace:MauiSampleApp.Controls"
xmlns:itemTemplates="clr-namespace:MauiSampleApp.Views.ItemTemplates"
xmlns:mct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:vm="clr-namespace:MauiSampleApp.ViewModels"
x:Class="MauiSampleApp.Views.MainPage"
Title="Firebase Push Notifications"
Expand All @@ -29,7 +29,7 @@
</ContentPage.Resources>

<ContentPage.Behaviors>
<mct:EventToCommandBehavior
<b:EventToCommandBehavior
Command="{Binding AppearingCommand}"
EventName="Appearing" />
</ContentPage.Behaviors>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Maui.Essentials" Version="8.0.7" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="Moq.AutoMock" Version="3.5.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="ObjectDumper.NET" Version="4.3.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.6" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Loading