Timer running in the background?


#1

Hello guys!

I am trying to add a page to my application, where the user can start a counter from x minutes, when it is expired the device will notify the user with a ringtone and he will be able to stop the ringtone with the device shake event.

Can you please help me how should i start? I need to run the timer even if the user’s device in standby or using another app.

Is it even possible?


#2

Hi @perenyitamas,
All you need is here:
Countdown Timer and onComplete events: https://www.npmjs.com/package/ng2-countdown
Ionic Native Shake Gesture: https://ionicframework.com/docs/native/shake/

Thanks,
Akhilesh


#3

thank you, i will definetly check this. Also it is strange, that the shake gesture is only supported on ios :open_mouth:


#4

A friend of mine add shake plugin in Android and it works. I just see it working five minutes ago. It is so strange that docs says that it has only support for IOS.