コンテンツにスキップ

@tauri-apps/plugin-notification

このコンテンツはまだ日本語訳がありません。

Send toast notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API.

Default: 3;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L294

High: 4;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L295

Low: 2;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L293

Min: 1;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L292

None: 0;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L291


Day: "day";

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L166

Hour: "hour";

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L167

Minute: "minute";

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L168

Month: "month";

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L163

Second: "second";

Not supported on iOS.

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L172

TwoWeeks: "twoWeeks";

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L164

Week: "week";

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L165

Year: "year";

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L162


Private: 0;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L300

Public: 1;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L301

Secret: -1;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L299

new Schedule(): Schedule

Schedule

Property Type Defined in
at undefined | object Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L176
every undefined | object Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L191
interval undefined | object Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L184

static at(
date,
repeating,
allowWhileIdle): Schedule
Parameter Type Default value
date Date undefined
repeating boolean false
allowWhileIdle boolean false

Schedule

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L199

static every(
kind,
count,
allowWhileIdle): Schedule
Parameter Type Default value
kind ScheduleEvery undefined
count number undefined
allowWhileIdle boolean false

Schedule

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L218

static interval(interval, allowWhileIdle): Schedule
Parameter Type Default value
interval ScheduleInterval undefined
allowWhileIdle boolean false

Schedule

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L207

Property Type Defined in
destructive? boolean Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L246
foreground? boolean Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L245
id string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L242
input? boolean Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L247
inputButtonTitle? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L248
inputPlaceholder? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L249
requiresAuthentication? boolean Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L244
title string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L243

Property Type Description Defined in
actions Action[] The list of associated actions Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L260
allowInCarPlay? boolean - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L263
customDismissAction? boolean - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L262
hiddenPreviewsBodyPlaceholder? string - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L261
hiddenPreviewsShowSubtitle? boolean - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L265
hiddenPreviewsShowTitle? boolean - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L264
id string The identifier of this action type Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L256

Property Type Defined in
actionTypeId? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L285
attachments Attachment[] Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L284
body? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L279
data Record<string, string> Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L282
extra Record<string, unknown> Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L283
group? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L280
groupSummary boolean Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L281
id number Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L276
schedule? Schedule Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L286
sound? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L287
tag? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L277
title? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L278

Attachment of a notification.

Property Type Description Defined in
id string Attachment identifier. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L236
url string Attachment URL. Accepts the asset and file protocols. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L238

Property Type Defined in
description? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L307
id string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L305
importance? Importance Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L312
lightColor? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L310
lights? boolean Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L309
name string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L306
sound? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L308
vibration? boolean Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L311
visibility? Visibility Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L313

Options to send a notification.

2.0.0

Property Type Description Defined in
actionTypeId? string Defines an action type for this notification. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L62
attachments? Attachment[] Notification attachments. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L111
autoCancel? boolean Automatically cancel the notification when the user clicks on it. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L127
body? string Optional notification body. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L44
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: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L36
extra? Record<string, unknown> Extra payload to store in the notification. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L115
group? string Identifier used to group multiple notifications. https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent/1649872-threadidentifier Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L68
groupSummary? boolean Instructs the system that this notification is the summary of a group on Android. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L72
icon? string Notification icon. On Android the icon must be placed in the app’s res/drawable folder. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L97
iconColor? string Icon color on Android. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L107
id? number The notification identifier to reference this object later. Must be a 32-bit integer. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L29
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: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L91
largeBody? string Multiline text. Changes the notification style to big text. Cannot be used with inboxLines. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L54
largeIcon? string Notification large icon (Android). The icon must be placed in the app’s res/drawable folder. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L103
number? number Sets the number of items this notification represents on Android. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L139
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: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L123
schedule? Schedule Schedule this notification to fire on a later time or a fixed interval. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L48
silent? boolean Changes the notification presentation to be silent on iOS (no badge, no sound, not listed). Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L131
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: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L83
summary? string Detail text for the notification with largeBody, inboxLines or groupSummary. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L58
title string Notification title. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L40
visibility? Visibility Notification visibility. Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L135

Property Type Defined in
body? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L271
id number Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L269
schedule Schedule Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L272
title? string Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L270

Property Type Description Defined in
day? number - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L145
hour? number - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L156
minute? number - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L157
month? number - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L144
second? number - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L158
weekday? number 1 - Sunday 2 - Monday 3 - Tuesday 4 - Wednesday 5 - Thursday 6 - Friday 7 - Saturday Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L155
year? number - Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L143

type PermissionState: "granted" | "denied" | "prompt" | "prompt-with-rationale";

Source: undefined

function active(): Promise<ActiveNotification[]>

Retrieves the list of active notifications.

Promise<ActiveNotification[]>

A promise resolving to the list of active notifications.

import { active } from '@tauri-apps/plugin-notification';
const activeNotifications = await active();

2.0.0

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L466


function cancel(notifications): Promise<void>

Cancels the pending notifications with the given list of identifiers.

Parameter Type
notifications number[]

Promise<void>

A promise indicating the success or failure of the operation.

import { cancel } from '@tauri-apps/plugin-notification';
await cancel([-34234, 23432, 4311]);

2.0.0

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L432


function cancelAll(): Promise<void>

Cancels all pending notifications.

Promise<void>

A promise indicating the success or failure of the operation.

import { cancelAll } from '@tauri-apps/plugin-notification';
await cancelAll();

2.0.0

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L449


function channels(): Promise<Channel[]>

Retrieves the list of notification channels.

Promise<Channel[]>

A promise resolving to the list of notification channels.

import { channels } from '@tauri-apps/plugin-notification';
const notificationChannels = await channels();

2.0.0

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L560


function createChannel(channel): Promise<void>

Creates a notification channel.

Parameter Type
channel Channel

Promise<void>

A promise indicating the success or failure of the operation.

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

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L526


function isPermissionGranted(): Promise<boolean>

Checks if the permission to send notifications is granted.

Promise<boolean>

import { isPermissionGranted } from '@tauri-apps/plugin-notification';
const permissionGranted = await isPermissionGranted();

2.0.0

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L326


function onAction(cb): Promise<PluginListener>
Parameter Type
cb (notification) => void

Promise<PluginListener>

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L570


function onNotificationReceived(cb): Promise<PluginListener>
Parameter Type
cb (notification) => void

Promise<PluginListener>

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L564


function pending(): Promise<PendingNotification[]>

Retrieves the list of pending notifications.

Promise<PendingNotification[]>

A promise resolving to the list of pending notifications.

import { pending } from '@tauri-apps/plugin-notification';
const pendingNotifications = await pending();

2.0.0

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L415


function registerActionTypes(types): Promise<void>

Register actions that are performed when the user clicks on the notification.

Parameter Type
types ActionType[]

Promise<void>

A promise indicating the success or failure of the operation.

import { registerActionTypes } from '@tauri-apps/plugin-notification';
await registerActionTypes([{
id: 'tauri',
actions: [{
id: 'my-action',
title: 'Settings'
}]
}])

2.0.0

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L398


function removeActive(notifications): Promise<void>

Removes the active notifications with the given list of identifiers.

Parameter Type
notifications object[]

Promise<void>

A promise indicating the success or failure of the operation.

import { cancel } from '@tauri-apps/plugin-notification';
await cancel([-34234, 23432, 4311])

2.0.0

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L483


function removeAllActive(): Promise<void>

Removes all active notifications.

Promise<void>

A promise indicating the success or failure of the operation.

import { removeAllActive } from '@tauri-apps/plugin-notification';
await removeAllActive()

2.0.0

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L502


function removeChannel(id): Promise<void>

Removes the channel with the given identifier.

Parameter Type
id string

Promise<void>

A promise indicating the success or failure of the operation.

import { removeChannel } from '@tauri-apps/plugin-notification';
await removeChannel();

2.0.0

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L543


function requestPermission(): Promise<NotificationPermission>

Requests the permission to send notifications.

Promise<NotificationPermission>

A promise resolving to whether the user granted the permission or not.

import { isPermissionGranted, requestPermission } from '@tauri-apps/plugin-notification';
let permissionGranted = await isPermissionGranted();
if (!permissionGranted) {
const permission = await requestPermission();
permissionGranted = permission === 'granted';
}

2.0.0

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L349


function sendNotification(options): void

Sends a notification to the user.

Parameter Type
options string | Options

void

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

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/notification/guest-js/index.ts#L371


© 2026 Tauri Contributors. CC-BY / MIT