OMIDAdEvents

Objective-C

@interface OMIDAdEvents : NSObject

Swift

class OMIDAdEvents : NSObject

Ad event API enabling the integration partner to signal to all verification providers when key events have occurred. Only one ad events implementation can be associated with the ad session and any attempt to create multiple instances will result in an error.

  • Initializes ad events instance associated with the supplied ad session.

    Declaration

    Objective-C

    - (nullable instancetype)initWithAdSession:(nonnull OMIDAdSession *)session
                                         error:(NSError *_Nullable *_Nullable)error;

    Swift

    init(adSession session: OMIDAdSession) throws

    Parameters

    session

    The ad session associated with the ad events.

    Return Value

    A new ad events instance associated with the supplied ad session. Returns nil if the supplied ad session is nil or if an ad events instance has already been registered with the ad session.

  • Notifies the ad session that an impression event has occurred.

    When triggered all registered verification providers will be notified of this event.

    NOTE: the ad session will be automatically started if this method has been called first.

    Declaration

    Objective-C

    - (BOOL)impressionOccurredWithError:(NSError *_Nullable *_Nullable)error;

    Swift

    func impressionOccurred() throws
  • Notifies the ad session that display loaded event has occurred.

    When triggered all registered verification providers will be notified of this event.

    Declaration

    Objective-C

    - (BOOL)loadedWithError:(NSError *_Nullable *_Nullable)error;

    Swift

    func loaded() throws
  • Notifies the ad session that video/audio loaded event has occurred.

    When triggered all registered verification providers will be notified of this event.

    Declaration

    Objective-C

    - (BOOL)loadedWithVastProperties:(OMIDVASTProperties *_Nonnull)vastProperties
                               error:(NSError *_Nullable *_Nullable)error;

    Swift

    func loaded(with vastProperties: OMIDVASTProperties) throws

    Parameters

    vastProperties

    contains static information about the video/audio placement.