@sayem314/react-native-keep-awake
Advanced tools
Comparing version 1.1.0 to 1.2.0
import React, { useEffect } from "react"; | ||
import { NativeModules } from "react-native"; | ||
import ReactNativeKCKeepAwake from "./NativeKCKeepAwake"; | ||
export const activateKeepAwake = () => { | ||
NativeModules.KCKeepAwake.activate(); | ||
ReactNativeKCKeepAwake.activate(); | ||
}; | ||
export const deactivateKeepAwake = () => { | ||
NativeModules.KCKeepAwake.deactivate(); | ||
ReactNativeKCKeepAwake.deactivate(); | ||
}; | ||
@@ -11,0 +12,0 @@ |
{ | ||
"name": "@sayem314/react-native-keep-awake", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Keep the screen from going to sleep. iOS, Android and Web.", | ||
@@ -28,3 +28,11 @@ "main": "index", | ||
"author": "Sayem Chowdhury", | ||
"license": "MIT" | ||
"license": "MIT", | ||
"codegenConfig": { | ||
"name": "ReactNativeKCKeepAwakeSpec", | ||
"type": "modules", | ||
"jsSrcsDir": ".", | ||
"android": { | ||
"javaPackageName": "com.sayem.keepawake" | ||
} | ||
} | ||
} |
@@ -11,2 +11,6 @@ This React Native package allows you to prevent the screen from going to sleep while your app is active. It's useful for things like navigation or video playback, where the user expects the app to remain visible over long periods without touch interaction. | ||
#### React Native new architecture | ||
You must use `react-native-keep-awake@1.2.0` or newer if you want to use the [RN new architecture](https://reactnative.dev/docs/the-new-architecture/landing-page). | ||
## Usage | ||
@@ -13,0 +17,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
30187
21
193
78