Gathering detailed insights and metrics for react-native-screen-idle-timer
Gathering detailed insights and metrics for react-native-screen-idle-timer
Gathering detailed insights and metrics for react-native-screen-idle-timer
Gathering detailed insights and metrics for react-native-screen-idle-timer
react-native-idle-timer
A cross-platform bridge that allows you to enable and disable the screen idle timer in your React Native app
rn-idle-timer
An API for disabling the screen idle timer for iOS and Android
@liukai2_p/react-native-idle-timer
A cros-platform bridge that allows you to enable and disable the screen idle timer in your React Native app
@react-native-oh-tpl/react-native-idle-timer
本项目基于 [react-native-idle-timer](https://github.com/marcshilling/react-native-idle-timer)
npm install react-native-screen-idle-timer
Typescript
Module System
Node Version
NPM Version
Java (43.53%)
C++ (17.67%)
Objective-C++ (12.59%)
Ruby (7.18%)
Objective-C (6.41%)
TypeScript (4.47%)
JavaScript (4.42%)
Starlark (1.45%)
Shell (1.16%)
CMake (0.69%)
C (0.25%)
Swift (0.16%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
6 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Apr 24, 2023
Latest Version
0.1.0
Package Id
react-native-screen-idle-timer@0.1.0
Unpacked Size
51.05 kB
Size
15.33 kB
File Count
20
NPM Version
8.18.0
Node Version
14.17.4
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
749
2
20
Prevent screen fron going to sleep on both iOS and Android.
1npm install react-native-screen-idle-timer
1import ScreenIdleTimer from 'react-native-screen-idle-timer'; 2 3// Method 1 4class MyComponent extends Component { 5 render() { 6 if (this.props.screenShouldBeAwake) { 7 return ( 8 <View> 9 <Text>Screen will be kept awake</Text> 10 <ScreenIdleTimer /> 11 </View> 12 ) 13 } else { 14 return ( 15 <View> 16 <Text>Screen can sleep</Text> 17 </View> 18 ); 19 } 20 } 21} 22 23// Method 2 24function changeKeepAwake(shouldBeAwake) { 25 if (shouldBeAwake) { 26 ScreenIdleTimer.activate(); 27 } else { 28 ScreenIdleTimer.deactivate(); 29 } 30} 31
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library
No vulnerabilities found.
No security vulnerabilities found.