Install @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-keep-awake and start using its current __CAPGO_KEEP_2__ __CAPGO_KEEP_3__. - __CAPGO_KEEP_4__ appの更新をリアルタイムで管理することで、ストアの手間を省きます。

コンテキスト: Capgo マーケティング ウェブサイト。役割: ウェブサイト コピー文。見つける場所: component doc/SignupCta.astro, component Hero.astro。

GitHub

Capgoを使用して、AI-Assistedセットアップを利用してプラグインをインストールできます。次のコマンドを使用して、CapgoスキルをAIツールに追加します。

ターミナルウィンドウ
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

次に、以下のプロンプトを使用してください。

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

Manual Setupを使用する場合は、以下のコマンドを実行して、下記のプラットフォーム固有の手順に従ってください。

ターミナルウィンドウ
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');

画面を暗くすることを許可します (keep awake を無効にします)。

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

現在のプラットフォームで keep awake 機能がサポートされているかどうかを確認します。

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

現在、画面を暗くしないようにしているかどうかを確認します。

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

「IsKeptAwakeResult」

isKeptAwake()メソッドの結果

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

真実の源

「真実の源」

このページはプラグインの src/definitions.tsパブリック API のアップストリーム変更時に再度同期してください。

あなたが使用している Getting Started ダッシュボードとAPIの操作を計画する場合、APIを @capgo/capacitor-keep-awake Using @capgo/capacitor-keep-awake APIの概要 APIの概要 導入 導入 APIのキー Capgoの実装詳細についてはAPIキーの詳細を参照してください、 デバイス Capgoの実装詳細についてはデバイスの詳細を参照してください。