Erste Schritte
Kopiere einen Setup-Prompt mit den Installationsschritten und dem vollständigen Markdown-Guide für dieses Plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-mute`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/mute/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Installieren
Abschnitt „Installation“Du kannst unser KI-gestütztes Setup nutzen, um das Plugin zu installieren. Füge die Capgo Skills mit dem folgenden Befehl deinem KI-Tool hinzu:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsNutze dann diesen Prompt:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-mute` plugin in my project.Wenn du ein manuelles Setup bevorzugst, installiere das Plugin mit den folgenden Befehlen und befolge die plattformspezifischen Anweisungen unten:
bun add @capgo/capacitor-mutebunx cap syncImportieren
Abschnitt mit dem Titel „Import“import { Mute } from '@capgo/capacitor-mute';Quickstart
Abschnitt „Quick start“import { Mute } from '@capgo/capacitor-mute';
const { value } = await Mute.isMuted();if (value) { showVisualAlert();} else { await playNotificationSound();}Beispiel: Sounds in einem Spiel gaten
Abschnitt: „Beispiel: Gate-Sounds in einem Spiel“Prüfe den Mute-Status beim Betreten eines Levels oder wenn der User aus dem Control Center zurückkehrt, da der Hardware-Schalter ohne App-Event geändert werden kann.
Häufige Stolperfallen
Abschnitt „Häufige Fallstricke“- Kein Web-Support: schütze Capacitor Web-Builds mit
Capacitor.getPlatform() === 'web'. - Not volume: mute reflects ringer or hardware mute, not media volume sliders.
- Android-Modi: Nur-Vibration oder Lautlos zählen bei Alarmtönen weiterhin als stumm.
API Übersicht
Abschnitt „API Übersicht“isMuted
Abschnitt „isMuted“Prüft, ob der Stummschalter des Geräts aktiviert ist.
import { Mute } from '@capgo/capacitor-mute';
const { value } = await Mute.isMuted();if (value) { console.log('Device is muted');} else { console.log('Device is not muted');}Typreferenz
Abschnitt mit dem Titel „Typreferenz“MuteResponse
Abschnitt mit dem Titel „MuteResponse“Antwort der Abfrage des Mute-Status.
export interface MuteResponse { /** True if device is muted, false otherwise */ value: boolean;}Source of Truth
Abschnitt mit dem Titel „Source of Truth“Diese Seite wird aus dem Plugin generiert src/definitions.ts. Führe den Sync erneut aus, wenn sich das öffentliche API upstream ändert.
Weiter geht's nach Getting Started
Abschnitt: „Weiter geht’s mit Getting Started“Wenn du es nutzt Erste Schritte um Dashboard- und API-Operationen zu planen, verbinde es mit Mit @capgo/capacitor-mute für die native Funktion in „Mit @capgo/capacitor-mute“, API Übersicht für Details zur Implementierung im API Overview, Einführung für die Implementierungsdetails in der Einleitung, API Schlüssel für das Implementierungsdetail in API Keys und Geräte für das Implementierungsdetail in Devices.