DeviceRegistrationCollector

open class DeviceRegistrationCollector : FieldCollector<String>, Submittable, Closeable, @unchecked Sendable

A collector for device registration information.

This class is responsible for collecting information about device registration, including the available devices and the user’s selection.

  • The list of available registration devices.

    Declaration

    Swift

    public private(set) var devices: [Device] { get }
  • The device selected by the user for registration.

    Declaration

    Swift

    public var value: Device?
  • Initializes a new instance of DeviceRegistrationCollector with the given JSON input.

    Declaration

    Swift

    public required init(with json: [String : Any])

    Parameters

    json

    A dictionary containing the collector’s configuration.

  • Returns the event type for this collector.

    Declaration

    Swift

    public func eventType() -> String

    Return Value

    A string representing the event type, which is “submit”.

  • Constructs the payload to be sent to the server.

    Declaration

    Swift

    override open func payload() -> String?

    Return Value

    The type of the selected device, or nil if no device is selected.

  • Resets the collector’s state by clearing the selected device.

    Declaration

    Swift

    public func close()