# How to understand that phone screen is off or app in background?

**URL:** <https://forum.ionicframework.com/t/how-to-understand-that-phone-screen-is-off-or-app-in-background/72904>\
**Category:** ionic-v1\
**Created:** [December 11, 2016, 12:29pm UTC](https://forum.ionicframework.com/t/how-to-understand-that-phone-screen-is-off-or-app-in-background/72904 "2016-12-11T12:29:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![azovl](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/azovl/32/90744_2.png) [@azovl](https://forum.ionicframework.com/u/azovl)\
**Post date:** [December 11, 2016, 12:29pm UTC](https://forum.ionicframework.com/t/how-to-understand-that-phone-screen-is-off-or-app-in-background/72904/1 "2016-12-11T12:29:52Z")

</div>

How to understand that phone screen is off or app in background? For example, using NativeAudio with setInterval. Every 10 sec - I’m playing sound. When app in background or screen is off - I heard this sound. But it should be not like that, need to specify that phone currently not active.

---

<div class="post-metadata">

**Author:** ![Sulot](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sulot/32/100183_2.png) [@Sulot](https://forum.ionicframework.com/u/Sulot)\
**Post date:** [December 11, 2016, 12:44pm UTC](https://forum.ionicframework.com/t/how-to-understand-that-phone-screen-is-off-or-app-in-background/72904/2 "2016-12-11T12:44:02Z")

</div>

> **[katzer/cordova-plugin-background-mode](https://github.com/katzer/cordova-plugin-background-mode)**
>
> cordova-plugin-background-mode - Keep app running in background

---

<div class="post-metadata">

**Author:** ![azovl](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/azovl/32/90744_2.png) [@azovl](https://forum.ionicframework.com/u/azovl)\
**Post date:** [December 11, 2016, 3:10pm UTC](https://forum.ionicframework.com/t/how-to-understand-that-phone-screen-is-off-or-app-in-background/72904/3 "2016-12-11T15:10:08Z")

</div>

@Sulot, if I right understand, with this library I can know is it background or not?

---

<div class="post-metadata">

**Author:** ![Sulot](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sulot/32/100183_2.png) [@Sulot](https://forum.ionicframework.com/u/Sulot)\
**Post date:** [December 11, 2016, 5:14pm UTC](https://forum.ionicframework.com/t/how-to-understand-that-phone-screen-is-off-or-app-in-background/72904/4 "2016-12-11T17:14:43Z")

</div>

“/cordova-plugin-background-mode”
