@tauri-apps/plugin-notification
Esta página aún no está disponible en tu idioma.
Send toast notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API.
Enumerations
Section titled “Enumerations”Importance
Section titled “Importance”Source: undefined
Enumeration Members
Section titled “Enumeration Members”Default
Section titled “Default”Default: 3;Source: undefined
High: 4;Source: undefined
Low: 2;Source: undefined
Min: 1;Source: undefined
None: 0;Source: undefined
ScheduleEvery
Section titled “ScheduleEvery”Source: undefined
Enumeration Members
Section titled “Enumeration Members”Day: "day";Source: undefined
Hour: "hour";Source: undefined
Minute
Section titled “Minute”Minute: "minute";Source: undefined
Month: "month";Source: undefined
Second
Section titled “Second”Second: "second";Source: undefined
Not supported on iOS.
TwoWeeks
Section titled “TwoWeeks”TwoWeeks: "twoWeeks";Source: undefined
Week: "week";Source: undefined
Year: "year";Source: undefined
Visibility
Section titled “Visibility”Source: undefined
Enumeration Members
Section titled “Enumeration Members”Private
Section titled “Private”Private: 0;Source: undefined
Public
Section titled “Public”Public: 1;Source: undefined
Secret
Section titled “Secret”Secret: -1;Source: undefined
Classes
Section titled “Classes”Schedule
Section titled “Schedule”Source: undefined
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Schedule(): Schedule;Returns
Section titled “Returns”Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
at |
| { allowWhileIdle: boolean; date: Date; repeating: boolean; } | undefined |
Source: undefined |
every |
| { allowWhileIdle: boolean; count: number; interval: ScheduleEvery; } | undefined |
Source: undefined |
interval |
| { allowWhileIdle: boolean; interval: ScheduleInterval; } | undefined |
Source: undefined |
Methods
Section titled “Methods”static at( date, repeating?, allowWhileIdle?): Schedule;Source: undefined
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
date |
Date |
undefined |
repeating |
boolean |
false |
allowWhileIdle |
boolean |
false |
Returns
Section titled “Returns”every()
Section titled “every()”static every( kind, count, allowWhileIdle?): Schedule;Source: undefined
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
kind |
ScheduleEvery |
undefined |
count |
number |
undefined |
allowWhileIdle |
boolean |
false |
Returns
Section titled “Returns”interval()
Section titled “interval()”static interval(interval, allowWhileIdle?): Schedule;Source: undefined
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
interval |
ScheduleInterval |
undefined |
allowWhileIdle |
boolean |
false |
Returns
Section titled “Returns”Interfaces
Section titled “Interfaces”Action
Section titled “Action”Source: undefined
Properties
Section titled “Properties”ActionType
Section titled “ActionType”Source: undefined
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
actions |
Action[] |
The list of associated actions | Source: undefined |
allowInCarPlay? |
boolean |
- | Source: undefined |
customDismissAction? |
boolean |
- | Source: undefined |
hiddenPreviewsBodyPlaceholder? |
string |
- | Source: undefined |
hiddenPreviewsShowSubtitle? |
boolean |
- | Source: undefined |
hiddenPreviewsShowTitle? |
boolean |
- | Source: undefined |
id |
string |
The identifier of this action type | Source: undefined |
ActiveNotification
Section titled “ActiveNotification”Source: undefined
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
actionTypeId? |
string |
Source: undefined |
attachments |
Attachment[] |
Source: undefined |
body? |
string |
Source: undefined |
data |
Record<string, string> |
Source: undefined |
extra |
Record<string, unknown> |
Source: undefined |
group? |
string |
Source: undefined |
groupSummary |
boolean |
Source: undefined |
id |
number |
Source: undefined |
schedule? |
Schedule |
Source: undefined |
sound? |
string |
Source: undefined |
tag? |
string |
Source: undefined |
title? |
string |
Source: undefined |
Attachment
Section titled “Attachment”Source: undefined
Attachment of a notification.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
id |
string |
Attachment identifier. | Source: undefined |
url |
string |
Attachment URL. Accepts the asset and file protocols. |
Source: undefined |
Channel
Section titled “Channel”Source: undefined
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
description? |
string |
Source: undefined |
id |
string |
Source: undefined |
importance? |
Importance |
Source: undefined |
lightColor? |
string |
Source: undefined |
lights? |
boolean |
Source: undefined |
name |
string |
Source: undefined |
sound? |
string |
Source: undefined |
vibration? |
boolean |
Source: undefined |
visibility? |
Visibility |
Source: undefined |
Options
Section titled “Options”Source: undefined
Options to send a notification.
2.0.0
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
actionTypeId? |
string |
Defines an action type for this notification. | Source: undefined |
attachments? |
Attachment[] |
Notification attachments. | Source: undefined |
autoCancel? |
boolean |
Automatically cancel the notification when the user clicks on it. | Source: undefined |
body? |
string |
Optional notification body. | Source: undefined |
channelId? |
string |
Identifier of the Channel that deliveres this notification. If the channel does not exist, the notification won’t fire. Make sure the channel exists with listChannels and createChannel. | Source: undefined |
extra? |
Record<string, unknown> |
Extra payload to store in the notification. | Source: undefined |
group? |
string |
Identifier used to group multiple notifications. https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent/1649872-threadidentifier | Source: undefined |
groupSummary? |
boolean |
Instructs the system that this notification is the summary of a group on Android. | Source: undefined |
icon? |
string |
Notification icon. On Android the icon must be placed in the app’s res/drawable folder. |
Source: undefined |
iconColor? |
string |
Icon color on Android. | Source: undefined |
id? |
number |
The notification identifier to reference this object later. Must be a 32-bit integer. | Source: undefined |
inboxLines? |
string[] |
List of lines to add to the notification. Changes the notification style to inbox. Cannot be used with largeBody. Only supports up to 5 lines. |
Source: undefined |
largeBody? |
string |
Multiline text. Changes the notification style to big text. Cannot be used with inboxLines. |
Source: undefined |
largeIcon? |
string |
Notification large icon (Android). The icon must be placed in the app’s res/drawable folder. |
Source: undefined |
number? |
number |
Sets the number of items this notification represents on Android. | Source: undefined |
ongoing? |
boolean |
If true, the notification cannot be dismissed by the user on Android. An application service must manage the dismissal of the notification. It is typically used to indicate a background task that is pending (e.g. a file download) or the user is engaged with (e.g. playing music). | Source: undefined |
schedule? |
Schedule |
Schedule this notification to fire on a later time or a fixed interval. | Source: undefined |
silent? |
boolean |
Changes the notification presentation to be silent on iOS (no badge, no sound, not listed). | Source: undefined |
sound? |
string |
The sound resource name or file path for the notification. ## Platform-specific behavior: - On macOS: use system sounds (e.g., “Ping”, “Blow”) or sound files in the app bundle - On Linux: use XDG theme sounds (e.g., “message-new-instant”) or file paths - On Windows: use file paths to sound files (.wav format) - On Mobile: use resource names | Source: undefined |
summary? |
string |
Detail text for the notification with largeBody, inboxLines or groupSummary. |
Source: undefined |
title |
string |
Notification title. | Source: undefined |
visibility? |
Visibility |
Notification visibility. | Source: undefined |
PendingNotification
Section titled “PendingNotification”Source: undefined
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
body? |
string |
Source: undefined |
id |
number |
Source: undefined |
schedule |
Schedule |
Source: undefined |
title? |
string |
Source: undefined |
ScheduleInterval
Section titled “ScheduleInterval”Source: undefined
Properties
Section titled “Properties”Type Aliases
Section titled “Type Aliases”PermissionState
Section titled “PermissionState”type PermissionState = "granted" | "denied" | "prompt" | "prompt-with-rationale";Source: undefined
Functions
Section titled “Functions”active()
Section titled “active()”function active(): Promise<ActiveNotification[]>;Source: undefined
Retrieves the list of active notifications.
Returns
Section titled “Returns”A promise resolving to the list of active notifications.
Example
Section titled “Example”import { active } from '@tauri-apps/plugin-notification';const activeNotifications = await active();2.0.0
cancel()
Section titled “cancel()”function cancel(notifications): Promise<void>;Source: undefined
Cancels the pending notifications with the given list of identifiers.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
notifications |
number[] |
Returns
Section titled “Returns”Promise<void>
A promise indicating the success or failure of the operation.
Example
Section titled “Example”import { cancel } from '@tauri-apps/plugin-notification';await cancel([-34234, 23432, 4311]);2.0.0
cancelAll()
Section titled “cancelAll()”function cancelAll(): Promise<void>;Source: undefined
Cancels all pending notifications.
Returns
Section titled “Returns”Promise<void>
A promise indicating the success or failure of the operation.
Example
Section titled “Example”import { cancelAll } from '@tauri-apps/plugin-notification';await cancelAll();2.0.0
channels()
Section titled “channels()”function channels(): Promise<Channel[]>;Source: undefined
Retrieves the list of notification channels.
Returns
Section titled “Returns”A promise resolving to the list of notification channels.
Example
Section titled “Example”import { channels } from '@tauri-apps/plugin-notification';const notificationChannels = await channels();2.0.0
createChannel()
Section titled “createChannel()”function createChannel(channel): Promise<void>;Source: undefined
Creates a notification channel.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
channel |
Channel |
Returns
Section titled “Returns”Promise<void>
A promise indicating the success or failure of the operation.
Example
Section titled “Example”import { createChannel, Importance, Visibility } from '@tauri-apps/plugin-notification';await createChannel({ id: 'new-messages', name: 'New Messages', lights: true, vibration: true, importance: Importance.Default, visibility: Visibility.Private});2.0.0
isPermissionGranted()
Section titled “isPermissionGranted()”function isPermissionGranted(): Promise<boolean>;Source: undefined
Checks if the permission to send notifications is granted.
Returns
Section titled “Returns”Promise<boolean>
Example
Section titled “Example”import { isPermissionGranted } from '@tauri-apps/plugin-notification';const permissionGranted = await isPermissionGranted();2.0.0
onAction()
Section titled “onAction()”function onAction(cb): Promise<PluginListener>;Source: undefined
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
cb |
(notification) => void |
Returns
Section titled “Returns”Promise<PluginListener>
onNotificationReceived()
Section titled “onNotificationReceived()”function onNotificationReceived(cb): Promise<PluginListener>;Source: undefined
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
cb |
(notification) => void |
Returns
Section titled “Returns”Promise<PluginListener>
pending()
Section titled “pending()”function pending(): Promise<PendingNotification[]>;Source: undefined
Retrieves the list of pending notifications.
Returns
Section titled “Returns”Promise<PendingNotification[]>
A promise resolving to the list of pending notifications.
Example
Section titled “Example”import { pending } from '@tauri-apps/plugin-notification';const pendingNotifications = await pending();2.0.0
registerActionTypes()
Section titled “registerActionTypes()”function registerActionTypes(types): Promise<void>;Source: undefined
Register actions that are performed when the user clicks on the notification.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
types |
ActionType[] |
Returns
Section titled “Returns”Promise<void>
A promise indicating the success or failure of the operation.
Example
Section titled “Example”import { registerActionTypes } from '@tauri-apps/plugin-notification';await registerActionTypes([{ id: 'tauri', actions: [{ id: 'my-action', title: 'Settings' }]}])2.0.0
removeActive()
Section titled “removeActive()”function removeActive(notifications): Promise<void>;Source: undefined
Removes the active notifications with the given list of identifiers.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
notifications |
object[] |
Returns
Section titled “Returns”Promise<void>
A promise indicating the success or failure of the operation.
Example
Section titled “Example”import { cancel } from '@tauri-apps/plugin-notification';await cancel([-34234, 23432, 4311])2.0.0
removeAllActive()
Section titled “removeAllActive()”function removeAllActive(): Promise<void>;Source: undefined
Removes all active notifications.
Returns
Section titled “Returns”Promise<void>
A promise indicating the success or failure of the operation.
Example
Section titled “Example”import { removeAllActive } from '@tauri-apps/plugin-notification';await removeAllActive()2.0.0
removeChannel()
Section titled “removeChannel()”function removeChannel(id): Promise<void>;Source: undefined
Removes the channel with the given identifier.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”Promise<void>
A promise indicating the success or failure of the operation.
Example
Section titled “Example”import { removeChannel } from '@tauri-apps/plugin-notification';await removeChannel();2.0.0
requestPermission()
Section titled “requestPermission()”function requestPermission(): Promise<NotificationPermission>;Source: undefined
Requests the permission to send notifications.
Returns
Section titled “Returns”Promise<NotificationPermission>
A promise resolving to whether the user granted the permission or not.
Example
Section titled “Example”import { isPermissionGranted, requestPermission } from '@tauri-apps/plugin-notification';let permissionGranted = await isPermissionGranted();if (!permissionGranted) { const permission = await requestPermission(); permissionGranted = permission === 'granted';}2.0.0
sendNotification()
Section titled “sendNotification()”function sendNotification(options): void;Source: undefined
Sends a notification to the user.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
string | Options |
Returns
Section titled “Returns”void
Example
Section titled “Example”import { isPermissionGranted, requestPermission, sendNotification } from '@tauri-apps/plugin-notification';let permissionGranted = await isPermissionGranted();if (!permissionGranted) { const permission = await requestPermission(); permissionGranted = permission === 'granted';}if (permissionGranted) { sendNotification('Tauri is awesome!'); sendNotification({ title: 'TAURI', body: 'Tauri is awesome!' });}2.0.0
© 2026 Tauri Contributors. CC-BY / MIT