Sending Notifications

Notifications are only available in secure contexts (HTTPS).

You can send notifications to your users with the HTML5 Notifications API. We intercept the notification and send a native OS notification to your user instead.

When sending a notification in a ToDesktop app is you do not have to request permission first with the Notification.requestPermission() method as you would in a web app.

If you only want to send notifications in your Desktop app you can check if the window.todesktop object is present:

if (window.todesktop) {
const notification = new Notification('Welcome to our desktop app.')