# How to detect if app (phone) is offline?

**URL:** <https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305>\
**Category:** Questions about Thunkable X\
**Created:** [July 5, 2019, 8:28pm UTC](https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305 "2019-07-05T20:28:10Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![vba](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vba](https://community.thunkable.com/u/vba)\
**Post date:** [July 5, 2019, 8:28pm UTC](https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305/1 "2019-07-05T20:28:10Z")

</div>

How to detect if app (phone) is offline?  
I’d like to show a different screen for when the app is offline.

Thank you!

---

<div class="post-metadata">

**Author:** ![Conor](https://avatars.discourse-cdn.com/v4/letter/c/9d8465/32.png) [@Conor](https://community.thunkable.com/u/Conor)\
**Post date:** [July 5, 2019, 9:03pm UTC](https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305/2 "2019-07-05T21:03:30Z")

</div>

You can use the `device is online?` block  
[https://docs.thunkable.com/device#get-online-offline-status](https://docs.thunkable.com/device#get-online-offline-status)

---

<div class="post-metadata">

**Author:** ![BlueWhaleYT](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bluewhaleyt/32/28437_2.png) [@BlueWhaleYT](https://community.thunkable.com/u/BlueWhaleYT)\
**Post date:** [July 6, 2019, 3:24am UTC](https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305/3 "2019-07-06T03:24:52Z")

</div>

I am wondering,  
If get other users online / offline status 😂😂

---

<div class="post-metadata">

**Author:** ![samclever](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@samclever](https://community.thunkable.com/u/samclever)\
**Post date:** [July 6, 2019, 6:06am UTC](https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305/4 "2019-07-06T06:06:06Z")

</div>

What do you mean? Like if in a chat app if the other person is onlice or not? If so that would require you to have each device send a “ping” to your firebase. I used one for a game that sent every 5 mins and then other devices checked the list and if a user hadnt pinged in the last 5 mins it was removed from the “online” list.

---

<div class="post-metadata">

**Author:** ![vba](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vba](https://community.thunkable.com/u/vba)\
**Post date:** [July 6, 2019, 6:04pm UTC](https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305/5 "2019-07-06T18:04:16Z")

</div>

Thank you for the responses! I meant just the user running the app, that component Connor mentioned solves it, apparently.

---

<div class="post-metadata">

**Author:** ![BlueWhaleYT](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bluewhaleyt/32/28437_2.png) [@BlueWhaleYT](https://community.thunkable.com/u/BlueWhaleYT)\
**Post date:** [July 17, 2019, 3:21pm UTC](https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305/6 "2019-07-17T15:21:34Z")

</div>

Oh I have interest @samclever

---

<div class="post-metadata">

**Author:** ![samclever](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@samclever](https://community.thunkable.com/u/samclever)\
**Post date:** [July 17, 2019, 6:09pm UTC](https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305/7 "2019-07-17T18:09:06Z")

</div>

What is it you’d like to know?

---

<div class="post-metadata">

**Author:** ![BlueWhaleYT](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bluewhaleyt/32/28437_2.png) [@BlueWhaleYT](https://community.thunkable.com/u/BlueWhaleYT)\
**Post date:** [July 18, 2019, 3:06am UTC](https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305/8 "2019-07-18T03:06:37Z")

</div>

> [@BlueWhaleYT](#):
>
> get other users online / offline status

May I?

---

<div class="post-metadata">

**Author:** ![samclever](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@samclever](https://community.thunkable.com/u/samclever)\
**Post date:** [July 18, 2019, 5:16pm UTC](https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305/9 "2019-07-18T17:16:44Z")

</div>

All i did was had a Parent in Firebase that said ONLINE and then when a user signed online the app would send an entry to that Parent as their UserName(id) and a timestamp. Every 3 mins that user would send an updated timestamp. Then each person online would send a call every 5 mins that would call ONLINE, make a list out of each entry and then run a procedure to remove all entry’s over 5 mins. I no longer have the example but if you understand the basics of it you should be able to make it work. The only thing I didnt know was how much data was used for each user constantly making and sending calls to Firebase PLUS, you would end up having to pay Firebase as you would use up all your calls/gets fairly quickly.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [January 5, 2020, 7:08pm UTC](https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305/10 "2020-01-05T19:08:42Z")

</div>

This is a cool way to check if users are engaged with the app!

---

<div class="post-metadata">

**Author:** ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)\
**Post date:** [January 5, 2020, 8:23pm UTC](https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305/11 "2020-01-05T20:23:01Z")

</div>

## Problem

This solution unfortunately doesn’t work so well. Because your device can be “online” which means it is connected via LTE or Wifi, but it doesn’t necessarily mean you are connected to the internet. My advice is to use a Firebase tag or some sort of actual method of checking if the devices is in fact connected, by attempting to pull a piece of data from a database of some sort (Firebase being an easy choice). And once you’ve received the value, then you’ll be “online”.

## Example

If your app uses **Firebase** and Firebase is currently down (which it is sometimes), then you can be _online_ but not necessarily _connected_ to the database, which subsequently would cause the app to not work, if of course your app relies on that database…

(edit)

To add, I have tested this and this is a problem I have had, especially when _slow internet_ gets too slow to work.

---

<div class="post-metadata">

**Author:** ![doctorsof](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/doctorsof/32/30099_2.png) [@doctorsof](https://community.thunkable.com/u/doctorsof)\
**Post date:** [June 6, 2020, 5:55pm UTC](https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305/12 "2020-06-06T17:55:23Z")

</div>

I have 5 users, i wonder which one is online which one is offline. I can use firebase or airtable.  
And also i used airtable, if device is online writing online it is good.  
But how can i learn which ones are offline? I didnt write offline on Airtable for this block.  
[https://docs.thunkable.com/device#get-online-offline-status](https://docs.thunkable.com/device#get-online-offline-status)

If i found devices imei number or something like that it will be great. Because of i didnt write sign-signup blocks we dont need. If i find with blocks any devices specific id i will set on airtable for online but how can i write offline i have no idea too.  
I tried 3 blocks but i cant.

 ![Firefox_Screenshot_2020-06-06T18-10-34.344Z](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/b/cb3e02b9baab7c5fa1ca42c6be34f1729ff8f041.png)

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 7, 2020, 10:29am UTC](https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305/13 "2020-06-07T10:29:21Z")

</div>

To define online users, you need to create a timer in the application that will periodically save the current value of the variable in a separate node. Using a different timer, the value of this variable is checked. If the value in the monitored node has not changed after the control time, it means that the user is not online.

---

<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:28am UTC](https://community.thunkable.com/t/how-to-detect-if-app-phone-is-offline/133305/14 "2024-11-08T11:28:02Z")

</div>


