Gio.Application.prototype.send_notification
function send_notification(id: String, notification: Gio.Notification): void {
// Gjs wrapper for g_application_send_notification()
}
Sends a notification on behalf of application to the desktop shell. There is no guarantee that the notification is displayed immediately, or even at all.
Notifications may persist after the application exits. It will be D-Bus-activated when the notification or one of its actions is activated.
Modifying notification after this call has no effect. However, the object can be reused for a later call to this function.
id may be any string that uniquely identifies the event for the application. It does not need to be in any special format. For example, "new-message" might be appropriate for a notification about new messages.
If a previous notification was sent with the same id, it will be replaced with notification and shown again as if it was a new notification. This works even for notifications sent from a previous execution of the application, as long as id is the same string.
id may be null, but it is impossible to replace or withdraw notifications without an id.
If notification is no longer relevant, it can be withdrawn with Gio.Application.prototype.withdraw_notification.
Since 2.40
- id
id of the notification, or null
- notification
the Gio.Notification to send