Skip to content

notify.send

Notifies the user: an omfp window shows it, and the devices subscribed to Web Push get it while no window has the focus (always with urgency: "high") (PRT-240).

/**
* `notify.send` params (PRT-240): text only; a press opens `url` (a path of the daemon's UI, e.g.
* `/app/Home/messaggi`), else the thread `threadId`, else the window.
*/
export type NotifySendParams = {
/** At most 500 characters. */
body: string;
/** A newer notification with the same tag replaces this one, on every device. */
tag?: string | null;
/** The thread it is about: pressing the notification selects it. */
threadId?: string | null;
/** At most 100 characters. */
title: string;
urgency?: Urgency | null;
/** Where pressing the notification goes: a path of the daemon's UI starting with `/`. */
url?: string | null;
};
/** What `notify.send` reached (PRT-240): an omfp window, and how many devices the push went to. */
export type NotifySent = {
/** The devices the push was sent to. */
devices: number;
/** An omfp window shows it (a notice, or a system notification while it has no focus). */
window: boolean;
};
/**
* How pressing a notification is: `normal` reaches the phones only while no omfp window has the focus, `high`
* always (PRT-240).
*/
export type Urgency = "normal" | "high";