How to store data when user is offline

If the user has no internet connection, how can I store value “offline” in airtable? I have used the Network component block “On Disconnect” but it is not storing the value obviously because we need an active internet connection to store data in airtable. Is there any solution to store text as “offline” in the database when user disconnects net connection? I can store “online” successfully when he is connected, but I’m not able to store “offline” when there is no internet. How does this process work?

1 Like

Show what you have tried…

when internet goes offline, how you can access to airtable without internet?

1 Like

Online api service can’t used without internet.
You should store in tinydb and when user online process to airtable

When user goes offline, store data in offline database (TinyDB). And, when user gets connection back then retrieve those data from TinyDB and store in Online Database (Airtable)

1 Like

You always Need internet to communicate with airtable. i think this not possible.

but you can store user data in TinyDB and Send/Update on Airtable when Internet is Connected.
Means you can Postpone Update.

1 Like

Yes, that is my question. How can I know when the user goes offline in my admin app?

1 Like

Yeah, I tried that, but it doesn’t make any sense because the value in the database will still be “online” and when he goes online (when internet is connected) then it should show “online” and if I called value from TinyDB then it will store “offline” which is false.

Does anyone have a solution for this? I am making a chatting app and I want to show last seen if he disconnected from the internet or closed the app. I can use “On App Stop” event if he closed the app, but if he disconnected from the internet then also it should show offline in a database. But it won’t get stored if there is no connection.

there is one DIY way to find user is online or offline but very critical.

User 1 App have to send particular value(to check user is online) User 2 App at every 5sec. and if you got responce from User 2 App then set User is online Else Offline.

For that you have to set value When Particular value Got then Post Online Value. else Offline.

And also you have to change Topic title. “mention How to show User is Online/Offline.” in topic title

1 Like

Its simple , so simple
send timestamp from user one every 2 second(it dont take that much data)
and when time stamp gets old by one minute means user get offline,so set last seen as that timestamp
now if you want to show in second user app then just add these i said above
it will say online if timestamp is not old by one minute (or you decide like 10second) else it will show last seen as timestamp

1 Like

Yes, the logic is nice, but if we don’t get any response from User 2 then how will it store the data as “offline”? If we do not get any response then it means the user has no internet connection and so the data will not be stored.

Yes brother I can check it without any problem but the value will not get stored in database as “offline” without having internet.

but other application can check

Yes, but only if the other user sends him a message. Or else it won’t work. I want to send value instantly in airtable as “offline” if he disconnects from the internet.

no when other person will open his profile then he will automatically see
else you have to get a bot to do this

So if user 1 disconnects from internet then the value in the database will still be “online” until user 2 opens the app.

yes it will be ,i dont know there is any other solution
you need a bot or server for that

1 Like

you can only implement on app close , not on internet off, because on disconnect it cant do anything to airtable

2 Likes

Yes, I know. How do Android studio developers manage it? What logic do they use? There must be an another way to do this :thinking: