Zum Inhalt springen

Anleitung zum Einstieg

GitHub

You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:

Zur Zwischenablage kopieren
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Includes install, sync, und die Quellmarkdowntext.

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-flash` plugin in my project.

Wenn Sie eine manuelle Einrichtung bevorzugen, installieren Sie das Plugin, indem Sie die folgenden Befehle ausführen und die unten angegebenen Plattform-spezifischen Anweisungen befolgen:

Terminalfenster
bun add @capgo/capacitor-flash
bunx cap sync
import { CapacitorFlash } from '@capgo/capacitor-flash';

Überprüft, ob ein 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 brightness
await CapacitorFlash.switchOn({ intensity: 1.0 });
// Turn on at half brightness
await CapacitorFlash.switchOn({ intensity: 0.5 });

Schaltet das Taschenlampenlicht aus.

import { CapacitorFlash } from '@capgo/capacitor-flash';
await CapacitorFlash.switchOff();

Ü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 die Taschenlampe ein oder aus.

import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.toggle();
console.log('Flashlight toggled, now on:', value);

Diese Seite wurde aus dem Plugin generiert. src/definitions.ts. Wenn sich die öffentliche API im Hintergrund ändert, führen Sie die Synchronisierung erneut durch.

Wenn Sie das Plugin verwenden Getting Started um das Dashboard und die API-Operationen zu planen, verbinden Sie es mit Mit @capgo/capacitor-flash Für die native Fähigkeit in Mit @capgo/capacitor-flash, API-Übersicht für die Implementierungsdetails in API Übersicht Einführung für die Implementierungsdetails in Einführung API Schlüssel für die Implementierungsdetails in API Schlüssel und Geräte für die Implementierungsdetails in Geräte.