Skip to content

witPranav/react-native-android-wake-screen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-android-wake-screen

Getting started

$ npm install react-native-android-wake-screen --save

Mostly automatic installation

$ react-native link react-native-android-wake-screen

Usage

This module helps turn the screen display on from within a headless function.

Add the following inside the project manifest (android/app/src/main/AndroidManifest.xml):

<uses-permission android:name="android.permission.WAKE_LOCK" />   //Add this line
<application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:turnScreenOn="true"                          // Add this line
      android:theme="@style/AppTheme">
import AndroidWakeScreen from 'react-native-android-wake-screen';

//inside your headless function
const MyHeadlessFunction = async () => {
  AndroidWakeScreen.wakeScreen();
};

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published