# 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:** 1
**Showing post:** 3

<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”.

---

_[View the full topic](https://community.thunkable.com/t/how-to-check-if-your-app-is-in-the-foreground-or-background/563740)._
