JSPM

expo-keep-awake

3.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1339033
  • Score
    100M100P100Q222220F
  • License MIT

Provides a React component that prevents the screen sleeping when rendered. It also exposes static methods to control the behavior imperatively.

Package Exports

  • expo-keep-awake

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (expo-keep-awake) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

expo-keep-awake

Provides a React component that prevents the screen sleeping when rendered. It also exposes static methods to control the behavior imperatively.

API documentation

Installation

This package is pre-installed in managed Expo projects. You may skip the rest of the installation guide if this applies to you.

For bare React Native projects, you must ensure that you have installed and configured the @unimodules/core package before continuing.

Add the package to your npm dependencies

npm install expo-keep-awake

Configure for iOS

Add the dependency to your Podfile and then run pod install.

pod 'EXKeepAwake', path: '../node_modules/expo-keep-awake/ios'

Configure for Android

  1. Append the following lines to android/settings.gradle:
include ':expo-keep-awake'
project(':expo-keep-awake').projectDir = new File(rootProject.projectDir, '../node_modules/expo-keep-awake/android')
  1. Insert the following lines inside the dependencies block in android/app/build.gradle:
api project(':expo-keep-awake')
  1. In MainApplication.java, import the package and add it to the ReactModuleRegistryProvider list:
import expo.modules.expo.modules.keepawake.KeepAwakePackage;
private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(Arrays.<Package>asList(
  // Your other packages will be here
  new KeepAwakePackage()
), Arrays.<SingletonModule>asList());

Contributing

Contributions are very welcome! Please refer to guidelines described in the contributing guide.