Device

Handles Device related requests with IMS web services. Unless otherwise specified, requests performed by this service are on the current Device.

Activate

To activate the current device for data collection, the following API can be used.

Concrete Example

let service = DeviceService()
service.activate(then: { result in
    switch result {
    case: .success(_)
        // activation successful
    case: .failure(_)
        // failure error
    }
})

Deactivate

Deactivate the current device for data collection. It may be desirable to deactivate a device if the host application's user logs out, or if the user becomes inactive.

To deactivate the current device for data collection, the following API can be used.

Concrete Example

let service = DeviceService()
service.deactivate(then: { result in
    switch result {
    case: .success(_)
        // deactivation successful
    case: .failure(_)
        // failure error
    }
})

Fetch

In order to fetch the currentDevice's model, the following API can be used.

Concrete Example

let service = DeviceService()
service.fetch(then: { result in
    guard !result.value.isEmpty else {
        // error
        return
    }
    completionHandler(.success(result.value))
})

Last updated