[BREAKGLASS] Append-only mirror of github.com/bluewallet/react-native-idle-timer
| android | ||
| ios/RNIdleTimer | ||
| LICENSE.md | ||
| package.json | ||
| README.md | ||
react-native-idle-timer
An Objective-C bridge that allows you to enable and disable the screen idle timer in your React Native app
Install
npm install react-native-idle-timer@latest --save- In the XCode's "Project navigator", right click on your project's Libraries folder ➜
Add Files to <...> - Go to
node_modules➜react-native-idle-timer➜ select theIdleTimerManagerfolder - Make sure
IdleTimerManager.mis listed under 'Compile Sources' in your project's 'Build Phases' tab
Usage
- In your React Native javascript code, bring in the native module:
var IdleTimerManager = require('NativeModules').IdleTimerManager;
- To disable the idle timer on a specific view component:
componentWillMount() {
IdleTimerManager.setIdleTimerDisabled(true);
}
componentWillUnmount() {
IdleTimerManager.setIdleTimerDisabled(false);
}