Zum Hauptinhalt springen
@capgo/capacitor-rich-notifications Kommunikation Open Source

Rich Notifications Capacitor Plugin

Lokale Benachrichtigungen mit Android-Channels, Progress-Layouts, Action-Buttons, Scheduling und iOS-Interruption-Levels

Installieren

bun add @capgo/capacitor-rich-notifications bunx cap sync
npm, pnpm oder yarn
  • npm install @capgo/capacitor-rich-notifications
  • pnpm add @capgo/capacitor-rich-notifications
  • yarn add @capgo/capacitor-rich-notifications

Anleitung

Rich Notifications in Capacitor nutzen

Verwendung von @capgo/capacitor-rich-notifications

Lokale Notifications mit Android Channels, Progress Layouts, Action Buttons, Scheduling und iOS Interruption Levels.

Installieren

bun add @capgo/capacitor-rich-notifications
bunx cap sync

Was dieses Plugin bietet

  • checkPermission - Status der lokalen Benachrichtigungsberechtigung prüfen.
  • requestPermission - Lokale Benachrichtigungsberechtigung anfordern.
  • createChannel - Android Notification Channel erstellen.
  • createChannelGroup - Android Channel Group erstellen.
  • deleteChannel - Android Notification Channel löschen.
  • display - Lokale Benachrichtigung sofort anzeigen.
  • schedule - Lokale Benachrichtigung planen.
  • cancel - Eine Benachrichtigung per ID abbrechen.
  • cancelAll - Alle vom Plugin verwalteten Benachrichtigungen abbrechen.
  • getDisplayed - Liste der Benachrichtigungen im Shade oder im Zentrum.
  • getPending - List scheduled notifications not yet shown.
  • getInitialNotification - Die Benachrichtigung zurückgeben, die die App geöffnet hat (falls vorhanden).
  • setBadge - App-Icon-Badge auf iOS festlegen.
  • registerActions - Eine wiederverwendbare Action-Kategorie registrieren.
  • getPluginVersion - Gibt den Versionsmarker der Plattform-Implementierung zurück.
  • addListener - Auf Press- und Dismiss-Events hören.

Anwendungsbeispiel

requestPermission und display

import { RichNotifications } from '@capgo/capacitor-rich-notifications';

await RichNotifications.requestPermission();

await RichNotifications.createChannel({
  id: 'messages',
  name: 'Messages',
  importance: 'high',
});

await RichNotifications.display({
  title: 'Hello',
  body: 'Tap to open the app',
  channelId: 'messages',
});

schedule

import { RichNotifications } from '@capgo/capacitor-rich-notifications';

await RichNotifications.schedule({
  notification: {
    id: 'reminder-1',
    title: 'Reminder',
    body: 'Your appointment starts soon',
    channelId: 'messages',
  },
  trigger: { type: 'timestamp', timestamp: Date.now() + 60_000 },
});

Vollständige Referenz

FAQ

Rich Notifications Plugin FAQ

Wie installiere ich das Rich Notifications Plugin in einer Capacitor App?

Führe "bun add @capgo/capacitor-rich-notifications" (oder "npm install @capgo/capacitor-rich-notifications") aus und danach "bunx cap sync", damit die iOS- und Android-Projekte die nativen code übernehmen. Importiere es in deiner App code aus "@capgo/capacitor-rich-notifications".

Funktioniert @capgo/capacitor-rich-notifications mit React, Vue und Angular?

Ja. Rich Notifications ist ein Capacitor Package und funktioniert daher mit jedem Web-Framework, das in Capacitor läuft, einschließlich Ionic, React, Vue, Angular, Svelte und reinem JavaScript.

Welche Capacitor Version wird von @capgo/capacitor-rich-notifications unterstützt?

Capgo Plugins folgen der Major-Version von Capacitor: Nutze die Plugin-Major-Version, die zu deiner Capacitor Major-Version passt (z. B. Plugin v8 mit Capacitor 8). Die Kompatibilitätstabelle im GitHub README listet die gepflegten Versionen auf.

Ist @capgo/capacitor-rich-notifications kostenlos und Open Source?

Ja. Der code Code ist öffentlich auf GitHub unter https://github.com/Cap-go/capacitor-rich-notifications/ einsehbar und das Paket kann kostenlos via npm installiert werden. Bug-Reports und Pull Requests sind willkommen.

Kann ich code mit Rich Notifications aktualisieren, ohne ein App Store Review abzuwarten?

Die Installation oder das Upgrade des Plugins ändert den nativen code, deshalb ist ein neuer Store-Build nötig. Danach lassen sich JavaScript-, HTML- und CSS-Änderungen, die das Plugin aufrufen, sofort mit Capgo Live Updates ausliefern.

Rich Notifications Änderungen ohne App-Review ausrollen

Sobald das Plugin in deinem Store-Build ist, pushen Capgo Live Updates deine JavaScript-, HTML- und CSS-Änderungen in Minuten an die Nutzer.

Starte mit Capgo