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:
spaceId(required): The space ID of the device.deviceId(required): The device ID.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(
spaceId = "spaceId",
deviceId = "deviceId",
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:
spaceId(required): The space ID of the device.deviceId(required): The device ID.request(required): The request object containing the updated device settings.
val request = UpdateDeviceSettingRequest(
isInPrivacyMode = true, // The new privacy mode status
)
InstaVision.deviceServices.updateDeviceSetting(
spaceId = "spaceId",
deviceId = "deviceId",
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:
spaceId(required): The space ID of the device.deviceId(required): The device ID.isOn(required): The new light mode status.
InstaVision.deviceServices.updateDeviceLightMode(
spaceId = "spaceId",
deviceId = "deviceId",
isOn = true,
onSuccess = { deviceSetting ->
// The updated device settings object
},
onError = { error ->
// The error object contains the error code and message
},
)