Skip to content
This repository has been archived by the owner on Aug 27, 2020. It is now read-only.

PhoneGap plugin that allows you to stop the screen sleeping (iOS + Android)

License

Notifications You must be signed in to change notification settings

mikeygcooper/PhoneGap-KeepScreenOn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Please note that I no longer maintain this repo

PhoneGap-KeepScreenOn

Plugin for PhoneGap

This small plugin allows you to keep the screen on whilst your application runs. Useful if you need to keep the screen on without the user having to interact with the application.

###Installation I'm currently working on creating a PhoneGap Build version of the plugin, however for now you need to manual install the plugins

####Android Download the plugin (git clone https://github.com/MikeyAlder/PhoneGap-KeepScreenOn). Save the plugin within your phonegap project Plugin directory to keep things clean

Create the folder com/mikeyalder in your android projects src folder

Copy over the KeepScreenOn.java file to this directory

Add the following to your config.xml

<feature name="KeepScreenOn">
    <param name="android-package" value="com.mikeyalder.KeepScreenOn" />
</feature>

Add the KeepScreenOn.js file to your assets/www folder and add the following code to your index.html

<script type="text/javascript" src="KeepScreenOn.js"></script>

####iOS Download the plugin (git clone https://github.com/MikeyAlder/PhoneGap-KeepScreenOn). Save the plugin within your phonegap project Plugin directory to keep things clean

Copy the KeepScreenOn.h and KeepScreenOn.m plugin files to your xcode project Plugins folder and add to your project

Add the following to your config.xml

<feature name="KeepScreenOn">
    <param name="ios-package" value="KeepScreenOn" />
</feature>

Add the KeepScreenOn.js file to your assets/www folder and add the following code to your index.html

<script type="text/javascript" src="KeepScreenOn.js"></script>

###Use To use the plugin just call either

keepScreenOn.enable();

Or

keepScreenOn.disable();

to enable and disable the plugin

About

PhoneGap plugin that allows you to stop the screen sleeping (iOS + Android)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published