AnalyticsCollecting

public protocol AnalyticsCollecting : AnyObject, Sendable

The AnalyticsCollecting protocol defines an interface for collecting AdswizzSDK analytics data. All events are delivered on a serial background executor. Note that the AnalyticsConnector class conforms to AnalyticsCollecting.

Callbacks are delivered off the main actor. A connector that needs main-actor state must hop there itself (e.g. via Task { @MainActor in … }).

  • Log an event matched to a category and level.

    Declaration

    Swift

    func log(_ event: AnalyticsEvent, _ timestamp: Date)

    Parameters

    event

    event to log

  • Force a send to all connectors. When you receive this call, the connector should try to flush all its stored events if forced is true.

    Declaration

    Swift

    func send(forced: Bool)

    Parameters

    forced

    true if the action is required immediately