@jsdaniell/react-native-no-sleep
v0.1.3
Published
Prevent React Native Apps to sleeping
Readme
@jsdaniell/react-native-no-sleep
Library to keep screen awake on React Native, working on iOS and Android.
Features
- Prevents the screen from sleeping on both iOS and Android devices.
- Lightweight and easy to use.
Installation
npm install @jsdaniell/react-native-no-sleepor
yarn add @jsdaniell/react-native-no-sleepUsage
import { activateKeepAwake, deactivateKeepAwake } from '@jsdaniell/react-native-no-sleep';
// To activate (keep the screen awake)
activateKeepAwake();
// To deactivate (allow the screen to sleep)
deactivateKeepAwake();API
activateKeepAwake()
Activates the library, preventing the screen from sleeping.
deactivateKeepAwake()
Deactivates the library, allowing the screen to sleep as usual.
Contributing
Contributions are welcome! Please see the CONTRIBUTING.md file for more information.
License
This project is licensed under the MIT License - see the LICENSE file for details.
