DeviceProfileConfig

public final class DeviceProfileConfig : @unchecked Sendable

Configuration object for customizing device profile collection.

This class allows fine-grained control over what data is collected and how the collection process behaves. It provides defaults that can be overridden based on application needs.

  • Whether to collect device metadata (platform, hardware, etc.)

    Declaration

    Swift

    public var metadata: Bool
  • Whether to collect device location information

    Declaration

    Swift

    public var location: Bool
  • Logger instance for recording collection events

    Declaration

    Swift

    public var logger: Logger
  • Device identifier generator for unique device identification. Default value is DefaultDeviceIdentifier()

    Declaration

    Swift

    public var deviceIdentifier: DeviceIdentifier?
  • Array of collectors to use for metadata gathering. Defaults valuse is DefaultDeviceCollector.defaultDeviceCollectors()

    Declaration

    Swift

    public var collectors: [any DeviceCollector]
  • Configures the collectors array using a builder pattern

    Usage Example

    config.collectors {
        return [
            PlatformCollector(),
            HardwareCollector(),
            CustomCollector()
        ]
    }
    

    Declaration

    Swift

    public func collectors(_ configBlock: () -> [any DeviceCollector])

    Parameters

    configBlock

    Block that returns the desired collectors array

  • Initializes a new instance of DeviceProfileConfig

    Declaration

    Swift

    public init()