0.1.0 • Published 8 years ago
rn-device-activity v0.1.0
React Native Device Activity
Device Activity Events for React Native (iOS and Android)
Install
npm i rn-device-activity --save
Configure
react-native link rn-device-activity
Usage
import {DeviceEventEmitter} from "react-native";
function handleResume() {
// called on suspend of app
}
function handlePause() {
// called on pause of app
}
function handleDestroy() {
// called on destroy of app
}
// Resume / Pause
DeviceEventEmitter.addListener("deviceResume", handleResume);
DeviceEventEmitter.addListener("devicePause", handlePause);
// Android ONLY
DeviceEventEmitter.addListener("deviceDestroy", handleDestroy);
0.1.0
8 years ago