Пример #1
0
 handleAppStateChange() {
   console.log("AppState", AppState.currentState);
   if (AppState.currentState == 'active') {
     this.getNumberOfUserOnlineOnceAndIncreaseBy1ByTransaction();
   } else if (AppState.currentState == 'inactive') {
     BackgroundTimer.setTimeout(() => this.decreaseNumberOfUserOnlineByTransaction(), 0);
   }
 }
Пример #2
0
 global.setTimeout = (fn, ms = 0) => BackgroundTimer.setTimeout(fn, ms);