1.2.0 • Published 7 years ago

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

Weekly downloads
35
License
MIT
Repository
github
Last release
7 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

7 years ago

1.1.0

7 years ago

1.0.8

7 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago