내용으로 건너뛰기

Getting Started

GitHub
터미널 창
bun add @capgo/capacitor-flash
bunx cap sync
import { CapacitorFlash } from '@capgo/capacitor-flash';

__CAPGO_KEEP_0__가 장치에 있는 플래시라이트가 있는지 확인합니다.

import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.isAvailable();
if (value) {
console.log('Flashlight is available');
}

플래시라이트를 켭니다.

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 });

플래시라이트를 끕니다.

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

flashlight가 현재 켜져 있는지 여부를 확인합니다.

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

flashlight를 켜거나 끕니다.

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

Source Of Truth 섹션 제목

이 페이지는 플러그인의

. upstream에서 변경된 public __CAPGO_KEEP_0__를 다시 동기화할 때입니다. src/definitions.ts. Re-run the sync when the public API changes upstream.

Getting Started에서 계속하기 섹션 제목

]}

만약에 __CAPGO_KEEP_0__을 사용하고 있다면 Getting Started API과 연동하여 대시보드 및 API 작업을 계획하세요. Using @capgo/capacitor-flash Using @capgo/capacitor-flash API Overview API Overview Introduction Introduction API Keys API Keys Devices __CAPGO_KEEP_0__ 구현 세부 사항.