Socket
Socket
Sign inDemoInstall

@capacitor-community/keep-awake

Package Overview
Dependencies
2
Maintainers
43
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @capacitor-community/keep-awake

Prevent your screen from getting some sleep!


Version published
Weekly downloads
9.8K
decreased by-1.21%
Maintainers
43
Install size
33.1 kB
Created
Weekly downloads
 

Changelog

Source

5.0.0 (2024-04-16)

⚠ BREAKING CHANGES

  • This plugin now only supports Capacitor 6.

Features

Readme

Source


Keep Awake

@capacitor-community/keep-awake

⚡️ Capacitor plugin to prevent devices from dimming or locking the screen.


Maintainers

MaintainerGitHubSocial
Kevin Boostenkevinboosten@kevinboosten
Robin Genzrobingenz@robin_genz

Installation

npm install @capacitor-community/keep-awake
npx cap sync

Configuration

No configuration required for this plugin.

Demo

A working example can be found here: robingenz/capacitor-plugin-demo

Usage

import { KeepAwake } from '@capacitor-community/keep-awake';

const keepAwake = async () => {
  await KeepAwake.keepAwake();
};

const allowSleep = async () => {
  await KeepAwake.allowSleep();
};

const isSupported = async () => {
  const result = await KeepAwake.isSupported();
  return result.isSupported;
};

const isKeptAwake = async () => {
  const result = await KeepAwake.isKeptAwake();
  return result.isKeptAwake;
};

API

keepAwake()

keepAwake() => Promise<void>

Prevent the device from dimming the screen.


allowSleep()

allowSleep() => Promise<void>

Allow the device to dim the screen.


isSupported()

isSupported() => Promise<IsSupportedResult>

Whether keep awake is supported or not.

Returns: Promise<IsSupportedResult>


isKeptAwake()

isKeptAwake() => Promise<IsKeptAwakeResult>

Check if the device is kept awake.

Returns: Promise<IsKeptAwakeResult>


Interfaces

IsSupportedResult
PropType
isSupportedboolean
IsKeptAwakeResult
PropType
isKeptAwakeboolean

Changelog

See CHANGELOG.md.

License

See LICENSE.

Keywords

FAQs

Last updated on 16 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc