시작하기
설치 단계와 이 플러그인의 전체 마크다운 가이드와 함께 설정 프롬프트를 복사합니다.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-keep-awake`
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/keep-awake/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.
설치
설치bun add @capgo/capacitor-keep-awakebunx cap syncImport
__CAPGO_KEEP_0__ importimport { KeepAwake } from '@capgo/capacitor-keep-awake';API 개요
API 개요keepAwake
__CAPGO_KEEP_1____CAPGO_KEEP_1__ 설명
import { KeepAwake } from '@capgo/capacitor-keep-awake';
await KeepAwake.keepAwake();console.log('Screen will stay awake');allowSleep
__CAPGO_KEEP_2____CAPGO_KEEP_2__ 설명
import { KeepAwake } from '@capgo/capacitor-keep-awake';
await KeepAwake.allowSleep();console.log('Screen can now dim');isSupported
__CAPGO_KEEP_3__현재 플랫폼에서 유지된 awake 기능이 지원되는지 확인합니다.
import { KeepAwake } from '@capgo/capacitor-keep-awake';
const { isSupported } = await KeepAwake.isSupported();if (isSupported) { console.log('Keep awake is supported');}isKeptAwake
isKeptAwake현재 장치가 유지된 awake 상태인지 확인합니다.
import { KeepAwake } from '@capgo/capacitor-keep-awake';
const { isKeptAwake } = await KeepAwake.isKeptAwake();console.log('Is kept awake:', isKeptAwake);타입 참조
타입 참조IsSupportedResult
IsSupportedResultisSupported() 메서드의 결과입니다.
export interface IsSupportedResult { /** * Whether keep awake is supported on the current platform. * * @since 1.0.0 */ isSupported: boolean;}IsKeptAwakeResult
IsKeptAwakeResultisKeptAwake() 메서드의 결과입니다.
export interface IsKeptAwakeResult { /** * Whether the device is currently being kept awake. * * @since 1.0.0 */ isKeptAwake: boolean;}실질적인 출처
실질적인 출처이 페이지는 플러그인의 src/definitions.ts공개 API이 업스트림에서 변경될 때 다시 동기화 하십시오.