Back

Automatic Document Refresh on the Server Side

  • 0
  • Webhooks
  • Flutter
  • Databases
  • Self Hosted
  • Functions
Sabit
9 Jul, 2023, 05:41

Hello! We have created a taxi app in flutter. So far everything is working fine, except for one. How to automatically update a document without flutter on the server side? For example, a taxi driver, when entering the application, presses the online button and can pick up the order. But there is a case where he exits the application without pressing offline. In this case, we should automatically change its status to inactive (offline). Do I need to write a function for this and deploy it to the server?

TL;DR
The user is asking how to automatically update a document on the server side to change the driver status to offline without using Flutter. They suggest using a cloud function to achieve this. Another user suggests creating a heartbeat by having the app update a last ping timestamp every minute, and if the app stops updating that timestamp after a certain period of time, the driver can be considered offline. The user confirms that they have created a taxi app in Flutter and needs a solution for automatically updating the driver's status.
Drake
9 Jul, 2023, 06:24

I always suggest creating a sort of heartbeat by having the app update a last ping timestamp every minute or so. If the app stops updating that timestamp after Y minutes, they can be considered offline

Sabit
9 Jul, 2023, 06:46

Okay, that's understandable. But how then to update the document on the server to change the driver status to offline automatic?

safwan
9 Jul, 2023, 09:26

probably with a cloud function

Sabit
9 Jul, 2023, 09:28

Thank you! Is it possible to do this through Dart?

safwan
9 Jul, 2023, 15:57

Yes! Dart 2.15, 2.16 and 2.17 are supported runtimes as of now.

Please take a look here for all the supported runtime environments https://appwrite.io/docs/functions#supportedRuntimes

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more