Emit event periodically (also when application is running in the background).
Currently for Android only.
npm install react-native-background-timer --save
rnpm link
var {DeviceEventEmitter} = React;
var BackgroundTimer = require('react-native-background-timer');
// start timing
BackgroundTimer.start(5000); // delay in milliseconds
// listen for event
DeviceEventEmitter.addListener('backgroundTimer', () => {
// this will be executed every 5 seconds
// also when application is running in the background
console.log('tic');
});
// you can explicitly stop timing
BackgroundTimer.stop();