Insomnia

Improve this doc

$ ionic plugin add https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git

Repo: https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin

Prevent the screen of the mobile device from falling asleep.

Supported platforms

Usage

import { Insomnia } from 'ionic-native';


Insomnia.keepAwake()
  .then(
    () => console.log('success'),
    () => console.log('error')
  );

Insomnia.allowSleepAgain()
  .then(
    () => console.log('success'),
    () => console.log('error')
  );

Static Members

keepAwake()

Keeps awake the application

Returns: Promise<any>

allowSleepAgain()

Allows the application to sleep again

Returns: Promise<any>

API

Native

General