Cancels the pending notifications with the given list of identifiers.
A promise indicating the success or failure of the operation.
Creates a notification channel.
A promise indicating the success or failure of the operation.
Retrieves the list of pending notifications.
A promise resolving to the list of pending notifications.
Register actions that are performed when the user clicks on the notification.
A promise indicating the success or failure of the operation.
Removes the active notifications with the given list of identifiers.
A promise indicating the success or failure of the operation.
Requests the permission to send notifications.
A promise resolving to whether the user granted the permission or not.
Sends a notification to the user.
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!' });
}
Retrieves the list of active notifications.