Hi, I use the fantastic Itoo Background extension to read a timestamp on Firebase Realtime. Through this Timestamp I detect if the device is offline for more than 10 minutes and, at that point I send a notification to the user. all this works correctly but I noticed that a “continuous” connection to the database is established. I would like to know if there is a way to read the value without creating simultaneous connections to the database, for example a reading every 5 minutes on the database.
Thanks.
How did you detect this?
It might work, if you use the alarmmanager extension together with itoo…
you could check each 15 minutes using 1 repeating alarm or define 2 repeating alarms to check more frequently
Taifun
Hi Taifun, I discovered it by looking at the concurrent connections on Firebase Realtime in the “usage” section, “last 60 minutes” period, noting that even with the device with the app closed, the connection always remained active. When I close the app I use “.Go offline” and when I initialize the app “Go online”, so the continuous connection is given by Itoo.
I’m currently trying as in the photo, and it seems, although I’m not sure yet, that the connection is no longer continuous but is activated only when the timer is called.
I confirm that this works correctly without creating a continuous connection with firebase.
You are using an outdated version of itoo
The latest version is here
and examples to connect to Firebase are here
Taifun