🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

react-native-idle-timer

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-idle-timer - npm Package Compare versions

Comparing version

to
1.0.1

4

package.json
{
"name": "react-native-idle-timer",
"repository": {
"repository": {
"type": "git",
"url": "https://github.com/marcshilling/react-native-idle-timer"
},
"version": "1.0.0",
"version": "1.0.1",
"author": "Marc Shilling (marcshilling)",

@@ -9,0 +9,0 @@ "description": "An Objective-C bridge that allows you to enable and disable the screen idle timer in your React Native app",

# 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_modules` ➜ `react-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:
```javascript
var IdleTimerManager = require('NativeModules').IdleTimerManager;
```
2. To disable the idle timer on a specific view component:
```javascript
componentWillMount() {
IdleTimerManager.setIdleTimerDisabled(true);
}
componentWillUnmount() {
IdleTimerManager.setIdleTimerDisabled(false);
}
```