NotificationPortal

class NotificationPortal(connection: DBusConnection)(source)

Wrapper around the org.freedesktop.portal.Notification D-Bus interface. Provides methods to send and withdraw desktop notifications, and observe action invocations.

Constructors

Link copied to clipboard
constructor(connection: DBusConnection)

Properties

Link copied to clipboard

A flow that emits when a notification action is invoked by the user.

Link copied to clipboard

Returns the interface version.

Functions

Link copied to clipboard
fun addNotification(id: String, data: Map<String, Variant<*>>): Result<Unit>

Sends a notification with a raw vardict for full control over notification fields.

fun addNotification(id: String, title: String, body: String, priority: NotificationPriority = NotificationPriority.NORMAL): Result<Unit>

Sends a notification with the given ID and content. Reusing an existing ID updates the previous notification.

Link copied to clipboard

Withdraws a previously sent notification.