-
Notifications
You must be signed in to change notification settings - Fork 0
Client Connection
In order to establish a connection from a client to the backend, you have to use a websocket. This connection can only be used from a registered user or from an appid.
For a device to server connection see Device Connection.
The current websocket path is:
/live/v1/client
The communication is event-based. So you always have to send data proactive. Every message contains a type attribute specifying the type of the event.
Using the following event you can enable your client receiving periodic updates about nearby drones. In order to use this event the server must know your position by sending an event containing clients` position.
{
"type": "registerGetNearbyDrones"
}
Cancle subscription for nearby drones.
{
"type": "unregisterGetNearbyDrones"
}
Using the following event you can enable your client receiving periodic updates about nearby rekari actions. In order to use this event the server must know your position by sending an event containing clients` position.
{
"type": "registerGetNearbyRescues"
}
Cancel subscription for nearby rescues.
{
"type": "unregisterGetNearbyRekariAction"
}
Send client position to server. This position will never be stored on the database. You are not allowed to send wrong positions otherwise your connection will be disconnected.
{
"type": "updateClientLocation",
"pos": {
"lat": YOUR_LAT,
"long": YOUR_LONG
}
}
Send clientID to client.
{
"type": "welcome",
"clientID": CLIENT_ID
}
...