TNDataCollectorClient

@objcMembers
public class TNDataCollectorClient : NSObject, LogInitiator

Undocumented

Public interface

  • Sends the event to data collector cloud.

    Declaration

    Swift

    @discardableResult
    @objc
    public func send(event: TNEvent) -> TNDataCollectorResponse

    Parameters

    event

    an event to be sent

    Return Value

    error in case of event is not supported, client is not cofigured etc. otherwise nil

  • Sends the events to data collector cloud.

    Declaration

    Swift

    @discardableResult
    @objc
    public func send(events: [TNEvent]) -> TNDataCollectorResponse

    Parameters

    events

    events to be sent

    Return Value

    error in case of event is not supported, client is not cofigured etc. otherwise nil

  • Adds consumer to subscription queue for event types

    Declaration

    Swift

    @discardableResult
    @objc
    public func subscribe(consumerWithName name: String,
                          forEventTypes types: [TNEventType],
                          withCallBack block: @escaping (_ occurredEvent: TNEvent)->()) -> TNDataCollectorResponse

    Parameters

    name

    the name of consumer. Should be unique.

    types

    the types of event to be subscribed for

    block

    the callback to be executed when event of the type happens

    Return Value

    error in case of consumer name is empty or consumer already exists for the event type etc.

  • Removes consumer from subscription queue for event types

    Declaration

    Swift

    @discardableResult
    @objc
    public func unsubscribe(consumerWithName name: String,
                            forEventTypes types: [TNEventType]) -> TNDataCollectorResponse

    Parameters

    name

    the name of consumer. Should be unique.

    types

    the types of event to be removed from

    Return Value

    error in case of conssumer name is empty etc.