I am trying to use the Windows 10 Notification Listener API in a Rust project of mine, and I ran into a mysterious error when trying to register a notification event handler:
listener.NotificationChanged(&TypedEventHandler::new(
move |_sender, args: &Option<UserNotificationChangedEventArgs>| {
Ok(())
},
))?;
Element not found. (0x80070490)
Digging deeper into the docs, I realized this might be a modern API that is only available to applications with identity. So, reasonably, I tried to add package identity to my Rust app, which resulted in a lot more setup. I needed to create a new self-signed certificate, package with MakeAppx.exe, sign with SignTool.exe, and ultimately in the end after all of that it still refuses to install.
So, my question is primarily: How can I resolve this issue / simplify the development workflow / simplify end user flow? Can I somehow use these APIs in a traditional binary / work around them using a different technique to avoid these requirements? I much preferred the format of a traditional EXE that calls system APIs rather than these "modernized" application systems, as this system introduces a lot of friction in development, for end-users, and for potential future contributors.
I dislike the requirement of needing a certificate for building the app, having to install it first before running, and the inherent complexity of integrating this into a system that does not use traditional windows development tools.