Notifications
Methods
Create Notification
Creates a new notification.
await window.deskifier.notifications.create({ arguments })
Arguments
titleString (Required)
A title for the notification, which will be displayed at the top of the notification window when it is shown.bodyString (Required)
The body text of the notification, which will be displayed below the title or subtitle.subtitleString macOS (Optional)A subtitle for the notification, which will be displayed below the title.
silentBoolean (Optional)
Whether or not to suppress the OS notification noise when showing the notification.iconDataURLString (Optional)
A data URL for a custom notification icon.hasReplyBoolean macOS (Optional)Whether or not to add an inline reply option to the notification.
timeoutTypeString Linux Windows (Optional)The timeout duration of the notification. Can be
defaultornever.replyPlaceholderString macOS (Optional)The placeholder to write in the inline reply input field.
closeButtonTextString macOS (Optional)
A custom title for the close button of an alert. An empty string will cause the default localized text to be used.toastXmlString Windows (Optional)A custom description of the Notification on Windows superseding all properties above. Provides full customization of design and behavior of the notification.
notificationIdString (Optional)An identifier for the notification. If left empty, an ID will be generated.
Returns
successBoolean
If the action was successful.messageString
Additional confirmation, or error details if action was unsuccessful.notificationIdString
The given or generated notification ID.
Example
const notificationOptions = {
title: "Hello!",
body: "This is a notification example.",
silent: true
};
const result = await window.deskifier.notifications.create(notificationOptions);
console.log(result.success) //true
Set Badge Count
Sets the counter badge for current app. Setting the count to 0 will hide the badge.
await window.deskifier.notifications.setBadgeCount({ arguments })
Arguments
countNumber (Required)
Returns
successBoolean
If the action was successful.messageString
Additional confirmation, or error details if action was unsuccessful.
Flash Frame
Starts or stops flashing the window in the taskbar to attract user's attention.
On macOS, this causes the application icon to "bounce". Additionally, on macOS, this action only works if the window isn't currently focused.
await window.deskifier.notifications.flashFrame({ arguments })
Arguments
flashBoolean (Required)windowIdString (Optional)
Defaults to the current window.
Returns
successBoolean
If the action was successful.messageString
Additional confirmation, or error details if action was unsuccessful.
Events
Notification Clicked
Fires when the notification is clicked by the user.
window.deskifier.notifications.onClicked((data) => { })
Arguments
notificationIdString
The given or generated notification ID.
Notification Reply
macOS Fires when the user types a reply in the notification.
window.deskifier.notifications.onReply((data) => { })
Arguments
notificationIdString
The given or generated notification ID.replyString
The user reply.