Class OmidAdSession

java.lang.Object
com.ooyala.pulse.OmidAdSession

public class OmidAdSession extends Object
This class is used to request OMID ad session.
  • Method Details

    • createOmidAdSession

      public static void createOmidAdSession(@NonNull PulseVideoAd pulseVideoAd, @NonNull android.content.Context context, @NonNull android.view.View adView, String contentUrl, List<FriendlyObstruction> friendlyObstructions)
      This method is used to create OMID ad session and should be called before playing ad content, otherwise ad session events will not be recorded and viewable impression events will not be tracked. If there aren't any friendlyObstructions, you should call createOmidAdSession(PulseVideoAd, Context, View, String) method instead.
      Parameters:
      pulseVideoAd - The PulseVideoAd that should be displayed.
      context - Application Context of the running application.
      adView - The native view that OMID should consider for viewability tracking.
      contentUrl - The deep link URL for the app screen that is displaying the ad.
      friendlyObstructions - The friendly obstructions that OMID will exclude from all viewability calculations. Notify all verification providers that the ad session has started and ad view tracking will begin.
    • createOmidAdSession

      public static void createOmidAdSession(@NonNull PulseVideoAd pulseVideoAd, @NonNull android.content.Context context, @NonNull android.view.View adView, String contentUrl)
      This method is used to create OMID ad session and should be called before playing ad content, otherwise ad session events will not be recorded and viewable impression events will not be tracked. This method should be called when there aren't any friendlyObstructions to register, otherwise you should call createOmidAdSession(PulseVideoAd, Context, View, String, List) It is possible to register friendlyObstructions later on as well, when they appear during the ad playback, by calling addFriendlyObstructions(List)
      Parameters:
      pulseVideoAd - The PulseVideoAd that should be displayed.
      context - Application Context of the running application.
      adView - The native view that OMID should consider for viewability tracking.
      contentUrl - The deep link URL for the app screen that is displaying the ad. Notify all verification providers that the ad session has started and ad view tracking will begin.
    • registerAdView

      public static void registerAdView(android.view.View adView)
      Utility method to update ad view. If the view changes at a subsequent time due to a fullscreen expansion or for a similar reason, you should always update the ad view reference to whatever is appropriate at that time. If an ad view is already registered for the current session, that ad view will be automatically unregistered and the new ad view will be registered in its place. This method will have no effect if called after the ad session has finished.
      Parameters:
      adView - The native view which should be registered for viewability tracking.
      Throws:
      IllegalArgumentException - if the supplied ad view is null.
    • addFriendlyObstructions

      public static void addFriendlyObstructions(List<FriendlyObstruction> friendlyObstructions)
      This method can be used to add friendly obstructions if they haven't been sent already while creating OMID ad session using createOmidAdSession(PulseVideoAd, Context, View, String, List). This method will have no effect if called after the OMID ad session has finished.
      Parameters:
      friendlyObstructions - The friendly obstructions to be excluded from all ad session viewability calculations.
    • removeFriendlyObstructions

      public static void removeFriendlyObstructions(List<FriendlyObstruction> friendlyObstructions)
      Remove registered friendly obstructions. This method will have no effect if called after the OMID ad session has finished.
      Parameters:
      friendlyObstructions - The friendly obstructions to be removed from the list of registered friendly obstructions.
    • removeAllFriendlyObstructions

      public static void removeAllFriendlyObstructions()
      Remove all registered friendly obstructions. This method will have no effect if called after the OMID ad session has finished.