# How to check if your app is in the foreground or background

**URL:** <https://community.thunkable.com/t/how-to-check-if-your-app-is-in-the-foreground-or-background/563740>\
**Category:** Questions about Thunkable X\
**Created:** [April 20, 2020, 3:09am UTC](https://community.thunkable.com/t/how-to-check-if-your-app-is-in-the-foreground-or-background/563740 "2020-04-20T03:09:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaythemanchs](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jaythemanchs/32/92809_2.png) [@jaythemanchs](https://community.thunkable.com/u/jaythemanchs)\
**Post date:** [April 20, 2020, 3:09am UTC](https://community.thunkable.com/t/how-to-check-if-your-app-is-in-the-foreground-or-background/563740/1 "2020-04-20T03:09:38Z")

</div>

Take a look at post 3.

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [July 7, 2020, 11:43am UTC](https://community.thunkable.com/t/how-to-check-if-your-app-is-in-the-foreground-or-background/563740/2 "2020-07-07T11:43:42Z")

</div>

Hi @jaythemanchs - setting the status to “active” seems straightforward enough - it’s getting to change to “inactive” automatically that I’m not sure of, especially if the app is closed.

Have you made any progress of this, or is this feature paused for the time being?

---

<div class="post-metadata">

**Author:** ![jaythemanchs](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jaythemanchs/32/92809_2.png) [@jaythemanchs](https://community.thunkable.com/u/jaythemanchs)\
**Post date:** [October 26, 2020, 7:46am UTC](https://community.thunkable.com/t/how-to-check-if-your-app-is-in-the-foreground-or-background/563740/3 "2020-10-26T07:46:59Z")

</div>

Hello @domhnallohanlon, long time no see.

Recently I have been working on a new app that can detect an online presence by saving an object that can saves every 5 seconds. Then it saves this to firebase under a user ID + session (aka “4tj30tj403igjeidjg sessions”). Other apps can look at the data with that same ID + session to see whether the data was made within 10 seconds of the real time. From there, its just a matter of adding if statements that can tell if the minute, hour, day, day of the month, month and year and creating a label for the if statement.

Happy coding everyone 🙂

Oh I nearly forgot the link 😆:  
[https://x.thunkable.com/copy/e883d5bf50bc39fdfd6d635412f9bfd4](https://x.thunkable.com/copy/e883d5bf50bc39fdfd6d635412f9bfd4)

Also, if you want me to explain how this works, please vote “YES”.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:25am UTC](https://community.thunkable.com/t/how-to-check-if-your-app-is-in-the-foreground-or-background/563740/4 "2024-11-08T11:25:00Z")

</div>


