Detect if Application not used for 30 seconds

Hi,
I would like to detect if user has not performed any action on application for 30 seconds, so I could show him Wallpaper Page

In Ionic 1, I could listen for touch, drag, swipe etc events and using interval, I could detect movement but here I’m not sure, how I could achieve this efficiently.

thanks