i have a gamer with a timer, when i use another app the timer still working i want the timer stop when i am not in the game how i can achieve that
this is the code
this.timer=this.paragraph.timer;
this.counter$ = Observable.timer(0, this.tick)
.take(this.timer)
.map(() => --this.timer).finally(() =>{ this.endTimer();});
i also tried this code
// this.counter$ = timer(0,this.tick).pipe(
// take(this.timer),
// map(() => --this.timer)
// ).finally(() =>{ this.endTimer();});
Look into the pause and resume events.
I tried it and its works:heart_eyes:
wekas
April 16, 2019, 12:46am
4
Hey @rapropos you seem quite knowledgeable on here. Do you happen to know any alternative for these events when using Capacitor?
These events do not emit on Capacitor yet. I am struggling to find a work around for this.
Does anyone know when this will be resolved? Or an alternative?
I’m starting to regret using Capacitor for this app. I may have been a bit early in adopting.
I can 't use capacitor plugins either as I am on an old webview version (44). Although I can use some native plugins.