Anfangen
Ein Vorschlag zum Einrichten mit den Installationsanweisungen und der vollständigen Markdown-Guideline für diesen Plugin kopieren.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-flash`
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/flash/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: Installierenbun add @capgo/capacitor-flashbunx cap syncImportieren
Abschnitt: Importierenimport { CapacitorFlash } from '@capgo/capacitor-flash';API Overview
Section titled “API Overview”isAvailable
Abschnitt: ist verfügbarÜberprüft, ob das Blitzlicht auf dem Gerät verfügbar ist.
import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.isAvailable();if (value) { console.log('Flashlight is available');}Schaltet den Taschenlampenlicht an.
import { CapacitorFlash } from '@capgo/capacitor-flash';
// Turn on at full brightnessawait CapacitorFlash.switchOn({ intensity: 1.0 });
// Turn on at half brightnessawait CapacitorFlash.switchOn({ intensity: 0.5 });switchOff
Abschnitt mit dem Titel „switchOff“Schaltet das Taschenlampenlicht aus.
import { CapacitorFlash } from '@capgo/capacitor-flash';
await CapacitorFlash.switchOff();isSwitchedOn
Abschnitt mit dem Titel „isSwitchedOn“Überprüft, ob die Taschenlampe derzeit eingeschaltet oder ausgeschaltet ist.
import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.isSwitchedOn();console.log('Flashlight is on:', value);Schaltet das Taschenlampenlicht ein oder aus.
import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.toggle();console.log('Flashlight toggled, now on:', value);Quelle der Wahrheit
Abschnitt mit dem Titel „Quelle der Wahrheit“Diese Seite wird aus dem Plugin generiert. src/definitions.tsRe-run the sync when the public API changes upstream.