nativebrik

Events

NativebrikEvent

Dispatched NativebrikEvent is sent to nativebrik server.

NativebrikEvent is the event that is dispatched when NativebrikClient.dispatch is called. When this event is dispatched, the NativebrikClient.overlay shows a popup experiment that is matched to the event.

Definition
public struct NativebrikEvent {
    public init(_ name: String)
}

You can dispatch NativebrikEvent by calling NativebrikClient.dispatch with NativebrikEvent instance.

Usage
nativebrikClient.dispatch(event: NativebrikEvent("<TRIGGER_EVENT_NAME>"))

ComponentEvent

ComponentEvent is the event that is dispatched when an experiment is interacted by a user. For example, when a user taps a button in an experiment, ComponentEvent is dispatched with the properties that you defined.

You can listen the ComponentEvent when initializing NativebrikClient or NativebrikExperiment.emdedding with onEvent argument.

Definition
public struct ComponentEvent {
    public let name: String?
    public let destinationPageId: String?
    public let deepLink: String?
    public let payload: [EventProperty]?
}

public struct EventProperty {
    public let name: String
    public let value: String
    public let type: EventPropertyType
}

public enum EventPropertyType {
    case INTEGER
    case STRING
    case TIMESTAMPZ
    case UNKNOWN
}
On this page