Zum Inhalt springen

Getting Started

GitHub

Sie können unsere AI-gestützte Einrichtung verwenden, um das Plugin zu installieren. Fügen Sie den Capgo-Fähigkeiten Ihrer AI-Werkzeugleiste mit folgendem Befehl hinzu:

Terminal-Fenster
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Dann verwenden Sie folgende Anfrage:

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

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

Terminal-Fenster
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 das Blitzlicht ein.

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 Blitzlicht aus.

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

Überprüft, ob das Blitzlicht 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 an oder aus.

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

Diese Seite wurde von dem Plugin generiert. src/definitions.tsRe-run die Synchronisation, wenn die öffentliche API upstream geändert wird.

Wenn Sie Getting Started 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.