handleAppStateChange() { console.log("AppState", AppState.currentState); if (AppState.currentState == 'active') { this.getNumberOfUserOnlineOnceAndIncreaseBy1ByTransaction(); } else if (AppState.currentState == 'inactive') { BackgroundTimer.setTimeout(() => this.decreaseNumberOfUserOnlineByTransaction(), 0); } }
global.setTimeout = (fn, ms = 0) => BackgroundTimer.setTimeout(fn, ms);