Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
electron-windows-interactive-notifications
:zap: Respond to interactive notifications on Windows, from Electron
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
We need something deeper than what Electron gives us out of the box, which means using NodeRT.
There's electron-windows-notifications, though it's wrapping a pretty old version of NodeRT, and it does not expose some of the APIs we'll need. I decided to directly use the generated NodeRT APIs.
These are the bare minimum. You can also target other API levels like @nodert-win10-au, etc. You'll need to set up node-gyp with Python and Windows Build Tools and install the Windows 10 SDK corresponding to the version of the NodeRT package you pulled in.
I've got a minimal example app to demonstrate the end-to-end protocol launch setup. I don't have this working for Mac OS yet but I think all it needs is an open-url event listener as per the docs.
Windows also lets you type directly into a notification, which is something that a pure protocol approach doesn't handle. electron-windows-interactive-notifications ostensibly handles this but it hasn't been updated in a while and the author is not responding to issues. I dove in here for a bit, implemented two workarounds, invented a third but never successfully got my app to launch. My app doesn't really need the interactive notifications, so I abandoned this approach. If you want to try and tackle this, Chromium's notification_helper.exe might be a helpful reference.