0.1.0 • Published 5 years ago

react-native-inback-timer-ios v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

react-native-inback-timer-ios

the react native timer that can run in iOS app background state

Install

npm install --save react-native-inback-timer-ios

ScreenShoot

screen-shoot

如果你恰好再天朝,请点击这里

Features

  1. it's a timer can run in background state
  2. support ios only
  3. provide the same API with javascript (setTimeout, setInterval, clear) etc.

Usage

  1. you need link library react-native-inback-timer-ios (don't know linking ? scan here first)
  2. import react-native-inback-timer-ios in your container
import BGTimer from 'react-native-inback-timer-ios';
  1. start your timer
let timerID = BGTimer.setInterval(() => {
    // do something..
    });
}, 1000);
                    
// ...
BGTimer.clear(timerID);

or

let timerID = BGTimer.setTimeout((data) => {
    // time out!
}, 9000);