The DataSampler module samples detailed device data and reports it back to the Workspace ONE UEM console. Device details such as analytics, call logs, GPS location, and network adapters are all sampled with the DataSampler.

Important:

For GPS sampling to function, ensure your application supports location tracking. For more information, see Apple's documentation at https://developer.apple.com/documentation/corelocation.

The DataSampler samples and transmits on two different time intervals. Device samples remain on to the disk and the system removes them after transmitted. This process allows the developer to sample statistics multiple times before sending them to Workspace ONE UEM. Samples stored on the disk are useful when a device does not have network connectivity.

AWDataSampler is a singleton object. There can only be one DataSampler for each process.

Configuration

These parameters are required to set up a DataSampler.

  • sampleModules – Names the bitmask whose flags specify which modules to use.

  • defaultSampleInterval – Specifies the time in seconds between DataSampler samples for all modules by default.

  • defaultTransmitInterval – Specifies the time in seconds between DataSampler transmissions for all modules by default.

  • traceLevel – Determines the error and information logging level of the DataSampler module when it is running.

Modules Available for SamplingThese modules are available for sampling in the DataSampler.

  • AWDataSamplerModuleSystem

  • AWDataSamplerModuleAnalytics

  • AWDataSamplerModuleGPS

  • AWDataSamplerModuleNetworkData

  • AWDataSamplerModuleNetworkAdapter

  • AWDataSamplerModuleWLAN2Sample

Gather Telecom Data Disable the AWDataSamplerModuleNetworkData mask if you gather telecom data using the Workspace ONE Intelligent Hub. If you enable this mask for the SDK, then you receive duplicate data from the Workspace ONE Intelligent Hub and from the SDK.

Set Do Not Disturb

You can use the SDK to set the do-not-disturb (DND) status on the Workspace ONE UEM server. You must enable the DND policy in the Workspace ONE UEM console. You can find the policy at Groups & Settings > All Settings > Devices & Users > General > Privacy > DO NOT DISTURB section.

The two relevant methods are fetchDeviceDNDStatus and setDeviceDNDStatus found in the AWDeviceDNDStatus object.

AnalyticsHelper

The AnalyticsHelper is a singleton with a property and a function. Send your custom analytics event from your application to the console with this process.

  1. Ask your admin to enable the Analytics setting in the SDK profile for the SDK-built application. This setting is in the console at Groups & Settings > All Settings > Apps > Settings and Policies > Settings > Analytics.

  2. In the application, call the recordEvent method on the singleton after the controllerDidFinishInitialCheck delegate callback returns.

    func sendAnalytics() {
           let analytics = AnalyticsHandler.sharedInstance
           analytics.recordEvent(AWSDK.AnalyticsEvent.customEvent, eventName: "EVENT_NAME", eventValue: "EVENT_VALUE", valueType: AWSDK.AnalyticsEventValueType.string)
       }

After the system records the event, it saves the event in the SDK container for two hours. After the two hours passes, the SDK sends analytics recorded to disk to the console the application re-starts.

Locate the data in the console in Apps & Books > Applications > Logging > SDK Analytics.