Getting Started
このプラグインのインストール手順と完全なマークダウンガイドを含むセットアッププロンプトをコピーしてください。
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 syncインポート
「インポート」セクションimport { KeepAwake } from '@capgo/capacitor-keep-awake';API オーバービュー
「API オーバービュー」セクションkeepAwake
「keepAwake」セクション画面を暗くしないようにする
import { KeepAwake } from '@capgo/capacitor-keep-awake';
await KeepAwake.keepAwake();console.log('Screen will stay awake');allowSleep
「allowSleep」セクション画面を暗くする (keep awake を無効にする)
import { KeepAwake } from '@capgo/capacitor-keep-awake';
await KeepAwake.allowSleep();console.log('Screen can now dim');isSupported
「isSupported」セクション現在のプラットフォームでキープアウェイク機能がサポートされているかどうかを確認します。
import { KeepAwake } from '@capgo/capacitor-keep-awake';
const { isSupported } = await KeepAwake.isSupported();if (isSupported) { console.log('Keep awake is supported');}isKeptAwake
「isKeptAwake」セクション現在、デバイスがキープアウェイクされているかどうかを確認します。
import { KeepAwake } from '@capgo/capacitor-keep-awake';
const { isKeptAwake } = await KeepAwake.isKeptAwake();console.log('Is kept awake:', isKeptAwake);型の参照
「型の参照」セクションIsSupportedResult
「IsSupportedResult」セクションisSupported() メソッドの結果です。
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がアップストリームで変更された場合に再度Syncを実行してください。
Getting Startedから続けてください
Section titled “Getting Startedから続けてください”Capgoを使用している場合 Getting StartedからDashboardと__CAPGO_KEEP_0__の計画と操作を開始するには、Capgoと接続してください to plan dashboard and API operations, connect it with Using @capgo/capacitor-keep-awake for the native capability in Using @capgo/capacitor-keep-awake, API Overview for the implementation detail in API Overview, Introduction for the implementation detail in Introduction, API Keys for the implementation detail in API Keys, and Devices for the implementation detail in Devices.