pr8x / desktopnotifications Goto Github PK
View Code? Open in Web Editor NEWA cross-platform C# library for native desktop "toast" notifications.
License: MIT License
A cross-platform C# library for native desktop "toast" notifications.
License: MIT License
When running on Windows 10 I get this error when creating a new WindowsNotificationManager:
DesktopNotifications.Windows.WindowsNotificationManager..ctor(DesktopNotifications.Windows.WindowsApplicationContext ): System.TypeLoadException: Could not load type 'Microsoft.Toolkit.Uwp.Notifications.ToastNotificationManagerCompat' from assembly 'Microsoft.Toolkit.Uwp.Notifications, Version=7.1.0.0, Culture=neutral, PublicKeyToken=4aff67a105548ee2'.
I can find this in the project dependencies
Could not load file or assembly 'DesktopNotifications.Windows, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Is there any progress for the macOS support? I'm trying to help with the MacOS API but I don't have any MacBook for now.
Error when notification button is pressed on FreeDesktop
Unhandled exception. Tmds.DBus.DisconnectedException: Signal handler for org.freedesktop.Notifications.NotificationClosed threw an exception
---> System.InvalidOperationException: Signal handler for org.freedesktop.Notifications.NotificationClosed threw an exception
---> System.Collections.Generic.KeyNotFoundException: The given key '16' was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at DesktopNotifications.FreeDesktop.FreeDesktopNotificationManager.OnNotificationClosed(ValueTuple`2 event) in /home/ryoumiya/Documents/DesktopNotifications/DesktopNotifications.FreeDesktop/FreeDesktopNotificationManager.cs:line 138
at Tmds.DBus.WrappedDisposable.Call[T](Action`1 action, T value, Boolean disposes)
at Tmds.DBus.CodeGen.DBusObjectProxy.<>c__DisplayClass7_0`1.<WatchNonVoidSignalAsync>b__0(Message msg, Exception ex)
at Tmds.DBus.DBusConnection.HandleSignal(Message msg)
--- End of inner exception stack trace ---
at Tmds.DBus.DBusConnection.HandleSignal(Message msg)
at Tmds.DBus.DBusConnection.HandleMessage(Message msg, IMessageStream peer)
at Tmds.DBus.DBusConnection.ReceiveMessages(IMessageStream peer, Action`2 disconnectAction)
--- End of inner exception stack trace ---
at DesktopNotifications.FreeDesktop.FreeDesktopNotificationManager.OnNotificationActionInvokedError(Exception obj) in /home/ryoumiya/Documents/DesktopNotifications/DesktopNotifications.FreeDesktop/FreeDesktopNotificationManager.cs:line 157
at Tmds.DBus.WrappedDisposable.Call[T](Action`1 action, T value, Boolean disposes)
at Tmds.DBus.CodeGen.DBusObjectProxy.<>c__DisplayClass7_0`1.<WatchNonVoidSignalAsync>b__0(Message msg, Exception ex)
at Tmds.DBus.DBusConnection.Disconnect(Boolean dispose, Exception exception)
at Tmds.DBus.Connection.Disconnect(Boolean dispose, Exception exception)
at Tmds.DBus.Connection.OnDisconnect(Exception e)
at Tmds.DBus.DBusConnection.EmitDisconnected(IMessageStream peer, Exception e)
at Tmds.DBus.DBusConnection.ReceiveMessages(IMessageStream peer, Action`2 disconnectAction)
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
OS: OpenSuse Leap 15.5
.net: 7.0
Just added the code from Avalonia example to my project. Targeted the new SDK. Everything builds fine except the line: public static INotificationManager notificationManager = AvaloniaLocator.Current.GetService<INotificationManager>() ?? throw new InvalidOperationException("Missing notification manager");
which throws.
According to the readme, looks like this doesn't support OSX. Adding this issue as a tracking issue for that support
hi,
I tried to use your library but it looks like the extension method has no second parameters
I have this prototype when I check locally
public static TAppBuilder SetupDesktopNotifications<TAppBuilder>(this TAppBuilder builder) where TAppBuilder : AppBuilderBase<TAppBuilder>, new()
I just installed the nuget and tried to follow the example
did I do something wrong ?
Still need to push some packages.
Can this library support .NET standard and not .NET Core 3
After installed DesktopNotifications
packages, my axamls are appeared x:DataType
twice.
I still wondering why this happen. I tried to create another project and copy all source code to other project, still happen this.
And I remembered, this happen could affected by installed NuGet packages recently. So I removed DesktopNotifications
packages and my axamls no more shows x:DataType
twice.
Is this .net5 ready or will it be?
And I'm new is this how you ask questions?
Need to wait for stable release of Microsoft.Toolkit.Uwp.Notifications, which could take a while...
Hey hey,
so I updated from 1.2.0 to 1.3.0 today and the same unchanged code now fails with
System.PlatformNotSupportedException
Operation is not supported on this platform.
at DesktopNotifications.Windows.WindowsNotificationManager..ctor(WindowsApplicationContext context)
My code:
public partial class App : Application
{
private readonly IHost _host;
public App()
{
_host = Host.CreateDefaultBuilder()
.ConfigureServices((hostContext, services) =>
{
services.AddSingleton<INotificationManager, WindowsNotificationManager>();
services.AddHostedService<UpdateMessageSubscriber>();
}).Build();
}
private async void App_OnStartup(object sender, StartupEventArgs e)
{
// throws exception now
INotificationManager notificationManager = _host.Services.GetRequiredService<INotificationManager>();
await notificationManager.Initialize();
await _host.StartAsync();
}
}
Thank you!
C:\Program Files\dotnet\sdk\6.0.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(1003,5): error NETSDK1149: DesktopNotifications.Windows.dll cannot be referenced because it uses built-in support for WinRT, which is no longer supported in .NET 5 and higher. An updated version of the component supporting .NET 5 is needed. For more information, see...
Also net6.0-windows gives the same error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.