Utilisation

Schedule a local reminder.

Ce type est utilisé par notifications.schedule

tsx
// Schedule a local reminder.
import { notifications, permissions } from 'kuito';

const { status } = await permissions.request('notifications');

if (status === 'granted')
  await notifications.schedule({ title: 'Your order shipped', url: 'shop://orders/42' });

Déclaration du type

ts
export type ScheduledNotification = {
  /** Replaces the pending or shown notification with this id. Absent, the platform makes one. */
  id?: string;
  title: string;
  body?: string;
  /**
   * The link a tap opens, as if it had opened the app: a `<Router linking>`
   * follows it to its route (docs/notifications.md#taps).
   */
  url?: string;
  /** When it shows: a Date, or milliseconds since the epoch. Absent, it shows now. */
  at?: Date | number;
};

Membres 5

NomTypeRequisDescription
idstringNonReplaces the pending or shown notification with this id. Absent, the platform makes one.
titlestringOui—
bodystringNon—
urlstringNonThe link a tap opens, as if it had opened the app: a <Router linking> follows it to its route (docs/notifications.md#taps).
atnumber | DateNonWhen it shows: a Date, or milliseconds since the epoch. Absent, it shows now.
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.