DeviceOperations

public class DeviceOperations

DeviceOperations is responsible for handling mobile device related operations for logged in user.

  • List all devices for current user.

    Declaration

    Swift

    public func list(limit: Int = 60, paginationToken: String? = nil, completionHandler: @escaping ((ListDevicesResult?, Error?) -> Void))

    Parameters

    limit

    The number of devices to list in current call. Defaults to 60(max possible value)

    paginationToken

    The pagination token returned in previous list call to get more devices.

    completionHandler

    completion handler for result or error.

  • Update status for specified device id.

    Declaration

    Swift

    public func updateStatus(deviceId: String, remembered: Bool, completionHandler: @escaping ((UpdateDeviceStatusResult?, Error?) -> Void))

    Parameters

    deviceId

    the device id which needs to be updated.

    remembered

    true if device has to be remembered. false to set it to not remembered.

    completionHandler

    completion handler for result or error.

  • Update status for current device.

    Declaration

    Swift

    public func updateStatus(remembered: Bool, completionHandler: @escaping ((UpdateDeviceStatusResult?, Error?) -> Void))

    Parameters

    remembered

    true if device has to be remembered. false to set it to not remembered.

    completionHandler

    completion handler for result or error.

  • Get details for specified device id.

    Declaration

    Swift

    public func get(deviceId: String, completionHandler: @escaping ((Device?, Error?) -> Void))

    Parameters

    deviceId

    deviceId for device whose details need to be fetched.

    completionHandler

    completion handler for result or error.

  • Get details of current device.

    Declaration

    Swift

    public func get(_ completionHandler: @escaping ((Device?, Error?) -> Void))

    Parameters

    completionHandler

    completion handler for result or error.

  • Forget specified device.

    Declaration

    Swift

    public func forget(deviceId: String, completionHandler: @escaping ((Error?) -> Void))

    Parameters

    deviceId

    The deviceId of device which needs to be stopped being tracked.

    completionHandler

    completion handler for result or error.

  • Forget current device. The device will no longer be tracked. Note: Calling updateStatus to remember the device after calling forget device will result in error. To remember a forgotten device, the user needs to re-login.

    Declaration

    Swift

    public func forget(_ completionHandler: @escaping ((Error?) -> Void))

    Parameters

    completionHandler

    completion handler for result or error.