메뉴로 이동

시작하기

설치

설치
터미널 창
bun add @capgo/capacitor-keep-awake
bunx cap sync

수입

수입
import { KeepAwake } from '@capgo/capacitor-keep-awake';

API 개요

API 개요

화면을 어둡게 하지 않도록 장치의 밝기를 유지합니다.

import { KeepAwake } from '@capgo/capacitor-keep-awake';
await KeepAwake.keepAwake();
console.log('Screen will stay awake');

__CAPGO_KEEP_1__

import { KeepAwake } from '@capgo/capacitor-keep-awake';
await KeepAwake.allowSleep();
console.log('Screen can now dim');

isSupported

__CAPGO_KEEP_3__

__CAPGO_KEEP_4__

import { KeepAwake } from '@capgo/capacitor-keep-awake';
const { isSupported } = await KeepAwake.isSupported();
if (isSupported) {
console.log('Keep awake is supported');
}

isKeptAwake

__CAPGO_KEEP_6__

__CAPGO_KEEP_7__

import { KeepAwake } from '@capgo/capacitor-keep-awake';
const { isKeptAwake } = await KeepAwake.isKeptAwake();
console.log('Is kept awake:', isKeptAwake);

__CAPGO_KEEP_9__

__CAPGO_KEEP_10__

IsSupportedResult

__CAPGO_KEEP_11__

isSupported() 메소드의 결과입니다.

export interface IsSupportedResult {
/**
* Whether keep awake is supported on the current platform.
*
* @since 1.0.0
*/
isSupported: boolean;
}

isKeptAwake() 메소드의 결과입니다.

export interface IsKeptAwakeResult {
/**
* Whether the device is currently being kept awake.
*
* @since 1.0.0
*/
isKeptAwake: boolean;
}

__CAPGO_KEEP_0__이 업스트림에서 변경될 때 다시 싱크를 실행하세요. src/definitions.ts. Re-run the sync when the public API changes upstream.

“Keep going from Getting Started” 섹션

Capgo를 사용 중이라면

isSupported() 메소드의 결과입니다. 시작하기 API를 위한 대시보드와 API 운영을 계획하고 연결하세요. @capgo/capacitor-keep-awake 사용 @capgo/capacitor-keep-awake의 네이티브 기능을 위한 사용 API 개요 API 개요의 구현 세부 정보를 위한 소개 소개의 구현 세부 정보를 위한 API 키 API 키의 구현 세부 정보를 위한 장치 장치의 구현 세부 정보를 위한