Zum Inhalt springen

Android-Setup

GitHub

Das Plugin fusioniert POST_NOTIFICATIONS in deine App (erforderlich ab Android 13+). Fordere die Runtime-Berechtigung an mit requestPermission(). Mindestens SDK: 24.

Erstelle Notification Channels mit createChannel vor dem Posten. Verwende channelId bei jeder Notification.

Für exakte Alarme, Full-Screen-Intents, und Foreground Service Notifications, füge Opt-in-Berechtigungen und den Foreground Service zu deinem App-Manifest hinzu. Von deinem Projekt-Root aus:

Terminalfenster
bun ./node_modules/@capgo/capacitor-rich-notifications/scripts/apply-notification-permissions.mjs --project .

Dieser Helper fügt SCHEDULE_EXACT_ALARM, USE_FULL_SCREEN_INTENT, FOREGROUND_SERVICE, FOREGROUND_SERVICE_SPECIAL_USEhinzu und deklariert app.capgo.richnotifications.RichForegroundService mit foregroundServiceType="specialUse".

Nutzt foregroundService: true und fullScreen: true nur, wenn diese Berechtigungen vorhanden sind.