Device Configuration and Update

Pre-requisite: The user has to be signed in to perform the following operations.


Update Device Information

To update the device information, The following method can be used:

  • device (required): The device object on which the operation has to be performed.
  • request (required): The request object containing the updated device information.
val request = UpdateDeviceRequest(
  name = "New Device Name", // The new name of the device
  location = "New Location", // The new location of the device
)
InstaVision.deviceServices.updateDeviceInfo(
  device = device,
  request = request,
  onSuccess = { device ->
    // The updated device object
  },
  onError = { error ->
    // The error object contains the error code and message
  },
)

Update Device Settings

To update the device settings, The following method can be used:

  • device (required): The device object on which the operation has to be performed.
  • request (required): The request object containing the updated device settings.
val request = UpdateDeviceSettingRequest(
  isInPrivacyMode = true, // The new privacy mode status
)
InstaVision.deviceServices.updateDeviceSetting(
  device = device,
  request = request,
  onSuccess = { deviceSetting ->
    // The updated device settings object
  },
  onError = { error ->
    // The error object contains the error code and message
  },
)

Toggle Device Light Mode

To update the device light mode, The following method can be used:

  • device (required): The device object on which the operation has to be performed.
  • isOn (required): The new light mode status.
InstaVision.deviceServices.updateDeviceLightMode(
  device = device,
  isOn = true,
  onSuccess = { deviceSetting ->
    // The updated device settings object
  },
  onError = { error ->
    // The error object contains the error code and message
  },
)

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
  },
)

This site uses Just the Docs, a documentation theme for Jekyll.