Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.
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
16 changes: 13 additions & 3 deletions DesktopNotifications.Apple/DesktopNotifications.Apple.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,36 @@

<!--Note: Dotnet currently does not allow to build on non-windows platforms when a windows TFM is specified-->
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT' ">
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<TargetFrameworks>netstandard2.0;net6.0-windows10.0.17763.0</TargetFrameworks>
<TargetFrameworks>net8.0-windows10.0.17763.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
<Nullable>enable</Nullable>
<LangVersion>8.0</LangVersion>
<LangVersion>latest</LangVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>A cross-platform C# library for native desktop "toast" notifications.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/pr8x/DesktopNotifications</PackageProjectUrl>
<Authors>DesktopNotifications.Apple</Authors>
<Product>DesktopNotifications.Apple</Product>
<Company>DesktopNotifications.Apple</Company>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageId>DesktopNotificationsNet8.Apple</PackageId>
<Title>DesktopNotificationsNet8.Apple</Title>
<VersionPrefix>1.3.4</VersionPrefix>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\DesktopNotifications\DesktopNotifications.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Project>
21 changes: 21 additions & 0 deletions DesktopNotifications.Apple/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Luis von der Eltz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
46 changes: 46 additions & 0 deletions DesktopNotifications.Apple/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# DesktopNotifications

A cross-platform C# library for native desktop "toast" notifications.

[![Build](https://github.com/pr8x/DesktopNotifications/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/pr8x/DesktopNotifications/actions/workflows/build.yml)
[![Nuget](https://img.shields.io/nuget/v/DesktopNotifications)](https://www.nuget.org/packages/DesktopNotifications/)
[![Nuget](https://img.shields.io/nuget/dt/DesktopNotifications)](https://www.nuget.org/packages/DesktopNotifications/)

[Screenshot (Linux)](.github/images/linux_demo_image_06_02_21.png?raw=true)

[Screenshot (Windows)](.github/images/win_demo_image_06_02_21.png?raw=true)

# Features

| | Windows | Linux (FreeDesktop.DBus) | OSX |
|--------------------------|---------|---------------------|-----|
| Show notifications | ✓ | ✓ | ✕ |
| Hide notifications | ✓ | ✓ | ✕ |
| Schedule notifications | ✓ | ✓* | ✕ |
| Launch actions | ✓** | ✕ | ✕ |
| Replacing notifications | ✕ | ✕ | ✕ |
| Buttons | ✓ | ✓ | ✕ |
| Audio | ✕ | ✕ | ✕ |
| Images | ✓ | ✓*** | ✕ |

<sub> * Scheduled notifications will only be delivered while the application is running. </sub>
<sub> ** This is currently not supported when targeting .netstandard </sub>
<sub> *** If supported by the notification server </sub>

# Application Context

Most operating systems require you to register the application in some form before you can actually send notifications. This registration process is handled by the `ApplicationContext`. On Windows (see `WindowsApplicationContext`) it will create and assign a [Application User Model Id](https://docs.microsoft.com/en-us/windows/win32/shell/appids) to the current process and associate a shell link in the start menu with it. This will cause your application to appear in the Windows Start Menu. On Linux/FreeDesktop.DBUS, the application context is just holding the name and optional icon of your application.

# Avalonia

The `DesktopNotifications.Avalonia` package offers support for the [Avalonia](https://github.com/AvaloniaUI/Avalonia) project. It doesn't do much on its own, it just provides helpers to register
the `INotificationManager` with the application builder. You can see an example of it in the Example.Avalonia project.


# Help wanted

My MacBook Pro is 11 years old now and it does not run OSX Mojave or higher. Unfortunately, Apple deprecated `NSUserNotificationCenter` with OSX 10.14 and I suppose they want us to use the newer `UNUserNotificationCenter` API instead. I would kindly appreciate any contributions from folks that own a more modern Mac and are interested in implementing the OSX backend using the new API.

# License

See [License](LICENSE.md)
20 changes: 15 additions & 5 deletions DesktopNotifications.Avalonia/DesktopNotifications.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,39 @@

<!--Note: Dotnet currently does not allow to build on non-windows platforms when a windows TFM is specified-->
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT' ">
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0-windows10.0.17763.0</TargetFrameworks>
<TargetFrameworks>net8.0-windows10.0.17763.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
<Nullable>enable</Nullable>
<LangVersion>8.0</LangVersion>
<LangVersion>latest</LangVersion>
<Description>A cross-platform C# library for native desktop "toast" notifications.</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/pr8x/DesktopNotifications</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageId>DesktopNotificationsNet8.Avalonia</PackageId>
<Title>DesktopNotificationsNet8.Avalonia</Title>
<VersionPrefix>1.3.4</VersionPrefix>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.1" />
<PackageReference Include="Avalonia" Version="11.1.4" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DesktopNotifications.FreeDesktop\DesktopNotifications.FreeDesktop.csproj" />
<ProjectReference Include="..\DesktopNotifications.Windows\DesktopNotifications.Windows.csproj" />
<ProjectReference Include="..\DesktopNotifications\DesktopNotifications.csproj" />
</ItemGroup>


<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Project>
21 changes: 21 additions & 0 deletions DesktopNotifications.Avalonia/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Luis von der Eltz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
46 changes: 46 additions & 0 deletions DesktopNotifications.Avalonia/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# DesktopNotifications

A cross-platform C# library for native desktop "toast" notifications.

[![Build](https://github.com/pr8x/DesktopNotifications/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/pr8x/DesktopNotifications/actions/workflows/build.yml)
[![Nuget](https://img.shields.io/nuget/v/DesktopNotifications)](https://www.nuget.org/packages/DesktopNotifications/)
[![Nuget](https://img.shields.io/nuget/dt/DesktopNotifications)](https://www.nuget.org/packages/DesktopNotifications/)

[Screenshot (Linux)](.github/images/linux_demo_image_06_02_21.png?raw=true)

[Screenshot (Windows)](.github/images/win_demo_image_06_02_21.png?raw=true)

# Features

| | Windows | Linux (FreeDesktop.DBus) | OSX |
|--------------------------|---------|---------------------|-----|
| Show notifications | ✓ | ✓ | ✕ |
| Hide notifications | ✓ | ✓ | ✕ |
| Schedule notifications | ✓ | ✓* | ✕ |
| Launch actions | ✓** | ✕ | ✕ |
| Replacing notifications | ✕ | ✕ | ✕ |
| Buttons | ✓ | ✓ | ✕ |
| Audio | ✕ | ✕ | ✕ |
| Images | ✓ | ✓*** | ✕ |

<sub> * Scheduled notifications will only be delivered while the application is running. </sub>
<sub> ** This is currently not supported when targeting .netstandard </sub>
<sub> *** If supported by the notification server </sub>

# Application Context

Most operating systems require you to register the application in some form before you can actually send notifications. This registration process is handled by the `ApplicationContext`. On Windows (see `WindowsApplicationContext`) it will create and assign a [Application User Model Id](https://docs.microsoft.com/en-us/windows/win32/shell/appids) to the current process and associate a shell link in the start menu with it. This will cause your application to appear in the Windows Start Menu. On Linux/FreeDesktop.DBUS, the application context is just holding the name and optional icon of your application.

# Avalonia

The `DesktopNotifications.Avalonia` package offers support for the [Avalonia](https://github.com/AvaloniaUI/Avalonia) project. It doesn't do much on its own, it just provides helpers to register
the `INotificationManager` with the application builder. You can see an example of it in the Example.Avalonia project.


# Help wanted

My MacBook Pro is 11 years old now and it does not run OSX Mojave or higher. Unfortunately, Apple deprecated `NSUserNotificationCenter` with OSX 10.14 and I suppose they want us to use the newer `UNUserNotificationCenter` API instead. I would kindly appreciate any contributions from folks that own a more modern Mac and are interested in implementing the OSX backend using the new API.

# License

See [License](LICENSE.md)
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

<!--Note: Dotnet currently does not allow to build on non-windows platforms when a windows TFM is specified-->
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT' ">
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<TargetFrameworks>netstandard2.0;net6.0-windows10.0.17763.0</TargetFrameworks>
<TargetFrameworks>net8.0-windows10.0.17763.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -15,14 +15,24 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/pr8x/DesktopNotifications</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageId>DesktopNotificationsNet8.FreeDesktop</PackageId>
<Title>DesktopNotificationsNet8.FreeDesktop</Title>
<VersionPrefix>1.3.4</VersionPrefix>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Tmds.DBus" Version="0.9.1" />
<PackageReference Include="Tmds.DBus" Version="0.20.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DesktopNotifications\DesktopNotifications.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Project>
21 changes: 21 additions & 0 deletions DesktopNotifications.FreeDesktop/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Luis von der Eltz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
46 changes: 46 additions & 0 deletions DesktopNotifications.FreeDesktop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# DesktopNotifications

A cross-platform C# library for native desktop "toast" notifications.

[![Build](https://github.com/pr8x/DesktopNotifications/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/pr8x/DesktopNotifications/actions/workflows/build.yml)
[![Nuget](https://img.shields.io/nuget/v/DesktopNotifications)](https://www.nuget.org/packages/DesktopNotifications/)
[![Nuget](https://img.shields.io/nuget/dt/DesktopNotifications)](https://www.nuget.org/packages/DesktopNotifications/)

[Screenshot (Linux)](.github/images/linux_demo_image_06_02_21.png?raw=true)

[Screenshot (Windows)](.github/images/win_demo_image_06_02_21.png?raw=true)

# Features

| | Windows | Linux (FreeDesktop.DBus) | OSX |
|--------------------------|---------|---------------------|-----|
| Show notifications | ✓ | ✓ | ✕ |
| Hide notifications | ✓ | ✓ | ✕ |
| Schedule notifications | ✓ | ✓* | ✕ |
| Launch actions | ✓** | ✕ | ✕ |
| Replacing notifications | ✕ | ✕ | ✕ |
| Buttons | ✓ | ✓ | ✕ |
| Audio | ✕ | ✕ | ✕ |
| Images | ✓ | ✓*** | ✕ |

<sub> * Scheduled notifications will only be delivered while the application is running. </sub>
<sub> ** This is currently not supported when targeting .netstandard </sub>
<sub> *** If supported by the notification server </sub>

# Application Context

Most operating systems require you to register the application in some form before you can actually send notifications. This registration process is handled by the `ApplicationContext`. On Windows (see `WindowsApplicationContext`) it will create and assign a [Application User Model Id](https://docs.microsoft.com/en-us/windows/win32/shell/appids) to the current process and associate a shell link in the start menu with it. This will cause your application to appear in the Windows Start Menu. On Linux/FreeDesktop.DBUS, the application context is just holding the name and optional icon of your application.

# Avalonia

The `DesktopNotifications.Avalonia` package offers support for the [Avalonia](https://github.com/AvaloniaUI/Avalonia) project. It doesn't do much on its own, it just provides helpers to register
the `INotificationManager` with the application builder. You can see an example of it in the Example.Avalonia project.


# Help wanted

My MacBook Pro is 11 years old now and it does not run OSX Mojave or higher. Unfortunately, Apple deprecated `NSUserNotificationCenter` with OSX 10.14 and I suppose they want us to use the newer `UNUserNotificationCenter` API instead. I would kindly appreciate any contributions from folks that own a more modern Mac and are interested in implementing the OSX backend using the new API.

# License

See [License](LICENSE.md)
21 changes: 16 additions & 5 deletions DesktopNotifications.Windows/DesktopNotifications.Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@

<!--Note: Dotnet currently does not allow to build on non-windows platforms when a windows TFM is specified-->
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT' ">
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0-windows10.0.17763.0</TargetFrameworks>
<TargetFramework>net8.0-windows10.0.17763.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<LangVersion>8.0</LangVersion>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>A cross-platform C# library for native desktop "toast" notifications.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/pr8x/DesktopNotifications</PackageProjectUrl>
<VersionPrefix>1.3.4</VersionPrefix>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageId>DesktopNotificationsNet8.Windows</PackageId>
<Title>DesktopNotificationsNet8.Windows</Title>
</PropertyGroup>

<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
Expand All @@ -29,8 +33,15 @@

<ItemGroup>
<ProjectReference Include="..\DesktopNotifications\DesktopNotifications.csproj" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Condition="'$(TargetFramework)' != 'netstandard2.0'" Version="7.0.2" />
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Condition="'$(TargetFramework)' == 'netstandard2.0'" Version="10.0.22000.196" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Condition="'$(TargetFramework)' != 'netstandard2.0'" Version="7.1.3" />
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Condition="'$(TargetFramework)' == 'netstandard2.0'" Version="10.0.26100.1742" />
<PackageReference Include="System.Drawing.Common" Version="8.0.10" />
</ItemGroup>

<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Project>
Loading