notifications.cancel
Takes back the notification with this id, whether it is pending or shown.
Verwendung
Schedule and cancel a reminder
import { notifications, permissions } from 'kuito';
const { status } = await permissions.request('notifications');
if (status === 'granted') {
const id = await notifications.schedule({
title: 'Stand-up',
body: 'In five minutes',
url: 'myapp://meetings/standup',
at: new Date(Date.now() + 5 * 60_000),
});
// Changed your mind:
await notifications.cancel(id);
}Signaturen
(id: string): Promise<void>Parameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
id | string | Ja | — |
Rückgabe
Promise<void>
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.