Don't getting position updates after adding Traccar Client as New Device via Api

Furqan Mughal 4 months ago

Hey, I am creating a Flutter application using Traccar Server features.
I am creating a new device on my user's account. I have already connected my socket and getting positions on receiver.
Issues are when i am adding new device via api POST / devices

  1. I have to restart application to reconnect socket to get location/position updates.
  2. I am getting position updates in socket after 10 minutes. Which means i have to wait for 10 minutes after adding a device. For a live project 10 minutes are very huge number.

Is there any why to get positions earlier ?
Or after adding new device can i get position of device at first so that i can show user that their tracker is added but live updates will be start's after 10 minutes or we can reduce this time?

Anton Tananaev 4 months ago

Have you checked if it works in the official app?

Furqan Mughal 4 months ago

Yes, I have checked on Traccar manager application. I have installed Traccar Client on different mobile and register a device. It shows all details like position, battery status and other info instantly in a minute. How did i get instant update with in a minute on my Flutter application when i am adding a device via api. I have to disconnect and reconnect socket in my flutter app to get update but updates comes after around 10 minutes. i have test this case twice.

Furqan Mughal 4 months ago

I want to get location updates instantly as it behave in Traccar Manager's map screen. After adding a device it shows device without information and in few seconds device information e.g online/offline status, Battery information percentage & isCharging status starts receiving. How do i get fast updates on my Flutter App. I have already connected socket for position updates but for safe side i am disconnecting and reconnecting my socket to get updates. Still getting position updates after up to 10 minutes approximate. Can we reduce the time to get update's earlier ? I am just adding device, do i have to do extra tasks as well ?

Anton Tananaev 4 months ago

The official app uses WebSocket, so the behavior is different from your app, it means you're doing something wrong on your end.

Furqan Mughal 4 months ago

I don't think so, I am also using WebSocket connect with my flutter application and if i am doing something wrong then my application should not ever start getting updates but in my case i am getting position updates after up to 1-10 minutes. I want to get location / position updates as soon as possible as it shows on Traccar Manager application with in a minute.

Furqan Mughal 4 months ago

Can you please tell me what Traccar manager does while adding a device. Means which apis or steps traccar manager follows so that i can do the same.

Anton Tananaev 4 months ago

All the code is open. You can look it up yourself.