Not Receiving Online/Offline events on Sockets

Furqan Mughal2 months ago

I have connected Socket on my Flutter Application. Also I have already added "Status Online" & "Status Offline" in Settings>Notifications. Furthermore, i have added on Settings>Device>myDevice>connections selected "Status Online" & "Status Offline" from Notifications dropdown. Now, I want to know when ever traccar client is coming online or offline. I am testing this use-case by toggle on/off on Traccar Client but this doesn't work at all and not send any online/offline event through socket. I had also try to offline my device my shut down, disconnect wifi and turn off location but nothing works.
Help me out, how would i get Traccar Client device online/offline event on my socket?
Thanks in advance!

Anton Tananaev2 months ago

Traccar Client doesn't support offline status because it uses HTTP protocol.

Furqan Mughal2 months ago

So, it only send type "deviceOnline" & "deviceUnknown" in events through socket ?

Anton Tananaev2 months ago

Yes.

Furqan Mughal2 months ago

"deviceOnline" type, event comes on socket instantly as Traccar Client become online. But "deviceUnknown" type status comes randomly after some time. Is there any way to get "deviceUnknown" event as device disconnected by internet or go offline or powered off

Anton Tananaev2 months ago

It's not random. There's very clear and simple logic for it.

Furqan Mughal2 months ago

Help me out! with the logic regarding "deviceUnknown" type event.

Anton Tananaev2 months ago

Try searching the forum.

Furqan Mughal2 months ago

sure! Thanks for your assistance.

Furqan Mughal2 months ago

Hey! Anton
I have checked about "deviceUnknown" its happening after 10 mints of not receiving location update from Traccar Client.
How do i reduce this time to 1 minute is there any settings on Traccar Manager or somewhere else ?

Anton Tananaev2 months ago
Furqan Mughal2 months ago

Thanks Anton