GPS Location
Pre-requisite: The user has to be signed in to perform the following operations.
A Trail camera records where it was placed. device.gpsLocation carries the name, latitude, longitude and lastUpdatedAt; cameras with their own receiver advertise the Location cluster (0xFC26, DeviceCluster.supportsLocation()). For the rest, the app sets the position from the phone with the call below. Events from the camera carry the position too, in event.gpsLocation.
Update Device Location
To update the location of the device, The following method can be used:
spaceId(required): The space ID of the device.deviceId(required): The ID of the device.request(required): The request object containing the new latitude, longitude and name.
val request = UpdateDeviceLocationRequest(
latitude = "12.9716",
longitude = "77.5946",
name = "New Location Name",
)
InstaVision.deviceServices.updateDeviceLocation(
spaceId = "spaceId",
deviceId = "deviceId",
request = request,
onSuccess = {
// The device location was updated successfully
},
onError = { error ->
// The error object contains the error code and message
},
)