I've been searching for a while now, and can't find anything for this with Phonegap only for Android or IOS.
So would be nice if someone knew how or if its even possible. Is there a way to check if the phone is in use/active, or if the phone is inactive/screen locked etc.?
Thanks
Yes, you can accomplish this by using two of the built-in phonegap events:
Example:
document.addEventListener("pause", yourCallbackFunction, false);
An example would be:
document.addEventListener("resume", onResume, false);
function onResume() {
// Handle the resume event
}
Hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With