1.2.0 • Published 9 years ago

react-native-keep-screen-on v1.2.0

Weekly downloads
35
License
MIT
Repository
github
Last release
9 years ago

react-native-keep-screen-on

Allows for the selective toggling of the KEEP_SCREEN_ON flag (Android) and the setIdleTimerDisabled flag (iOS).

Installation

npm install react-native-keep-screen-on --save

Configuration

With rnpm

Just run rnpm link react-native-keep-screen-on

Manually

In settings.gradle add the following lines:

include ':KeepScreenOn'
project(':KeepScreenOn').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-keep-screen-on/android')

In build.gradle add the following line:

compile project(':KeepScreenOn')

< 0.29 : In MainActivity.java add the following lines:

import com.gijoehosaphat.keepscreenon.KeepScreenOnPackage;
new KeepScreenOnPackage(this)

>= 0.29 : In MainApplication.java add the following lines:

import com.gijoehosaphat.keepscreenon.KeepScreenOnPackage;
new KeepScreenOnPackage(this)

Example usage:

import KeepScreenOn from 'react-native-keep-screen-on'
...
//Keep screen on...
KeepScreenOn.setKeepScreenOn(true)

//Reset to default behavior...
KeepScreenOn.setKeepScreenOn(false)
1.2.0

9 years ago

1.1.0

9 years ago

1.0.8

9 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago