[BREAKGLASS] Append-only mirror of github.com/bluewallet/react-native-idle-timer
Go to file
2016-04-21 15:48:10 -04:00
android lets see if this works 2016-04-21 15:48:10 -04:00
ios/RNIdleTimer lets see if this works 2016-04-21 15:48:10 -04:00
LICENSE.md lets see if this works 2016-04-21 15:48:10 -04:00
package.json 1.0.1 2015-08-25 12:05:58 -04:00
README.md Update README.md 2015-08-25 12:04:40 -04:00

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

  1. npm install react-native-idle-timer@latest --save
  2. In the XCode's "Project navigator", right click on your project's Libraries folder ➜ Add Files to <...>
  3. Go to node_modulesreact-native-idle-timer ➜ select the IdleTimerManager folder
  4. Make sure IdleTimerManager.m is listed under 'Compile Sources' in your project's 'Build Phases' tab

Usage

  1. In your React Native javascript code, bring in the native module:
var IdleTimerManager = require('NativeModules').IdleTimerManager;
  1. To disable the idle timer on a specific view component:
componentWillMount() {
  IdleTimerManager.setIdleTimerDisabled(true);
}

componentWillUnmount() {
  IdleTimerManager.setIdleTimerDisabled(false);
}