#Realtime turns off after 30 minutes

28 messages · Page 1 of 1 (latest)

narrow condor
#

Hello! When the application is in the background after exactly 30 minutes in real time, the automatic function is disabled, why is this so in flutter, how can this be solved?

gilded quarry
#

You can exclude the app from battery optimisation so it doesn't gets killed or implement a foreground service

narrow condor
#

How can I disable this or do I need to send a request to the server every 5 minutes in the background so that the system does not disable this to save battery?

gilded quarry
narrow condor
#

the application is a taxi service and a chat at the same time

gilded quarry
#

Or the realtime connection is to get the messages?

narrow condor
#

yes to receive real time message

gilded quarry
#

To get the messages in the background, you should use the appwrite messaging feature

#

When the user open the app, you fetch all the messages and stablish a realtime connection in order to get updates and the newest messages sent

#

I think it's better doing that because having a constant real-time connection will drain a lot of battery unnecessarily in the background

void sonnet
#

You can use messaging for realtime notification nothing else

gilded quarry
narrow condor
#

I searched for a solution for a long time, but was able to solve the problem. Only realtime does not work after 30 minutes. and everything else works. For realtime to work again, you need to restart the application

void sonnet
gilded quarry
#

Because it will use more battery

#

And it's not needed at all

narrow condor
#

For example, the real-time feature works when the application is in the foreground. And let it not work when the application is in the background. And when the application moves to the foreground again, realtime no longer works. This happens if the application is in the background for exactly 30 minutes or more. Everything works for up to 30 minutes. but after 30 minutes the system does not kill the application. Only realtime doesn't work again. To get everything working again, you need to close and launch the application again.

#

I don't need real time work in the background. But I want the real time function to work when I switch to the foreground again. If after 30 minutes I switch to foreground, realtime stops working

void sonnet
#

You can connect again when the app comes in foreground

narrow condor
#

I wanted to resubscribe when the application switches to the foreground again, but in this case the subscription is duplicated and the console shows 2 connections when in fact only one client is connected

#

or do you need to close the subscription when switching to background?

odd blaze