title: how to check app running in foreground or background in ionic/cordova/phonegap
body: <p>Is there any way to check whether the app is running in foreground or background in ionic/cordova/phonegap, I need to use it on android and ios, thanks a lot</p>