Class AdSessionContext

java.lang.Object
com.iab.omid.library.adsession.AdSessionContext

public final class AdSessionContext extends Object
This class will provide the ad session both details of the partner and whether this is considered HTML or native.

Created by Natasha Garner on 01/08/2017.

  • Method Details

    • createHtmlAdSessionContext

      public static AdSessionContext createHtmlAdSessionContext(Partner partner, WebView webView, String contentUrl, String customReferenceData)
      Create a new "html" ad session context.
      Parameters:
      partner - details of the integration partner responsible for the ad session
      webView - responsible for serving the ad content
      contentUrl - containing the deep link to the ad's screen.
      customReferenceData - containing reference data specific to the integration partner.
      Returns:
      a new HTML context instance
      Throws:
      IllegalArgumentException - if the supplied partner is null.
      IllegalArgumentException - if the supplied webView is null.
      IllegalArgumentException - if customReferenceData is greater than 256 characters.
      See Also:
    • createJavascriptAdSessionContext

      public static AdSessionContext createJavascriptAdSessionContext(Partner partner, WebView webView, String contentUrl, String customReferenceData)
      Create a new "javascript" ad session context. This can be used when the integration renders creatives using native APIs but runs other JavaScript code in a webview, which then can also be provided here to run measurement code in.
      Parameters:
      partner - details of the integration partner responsible for the ad session
      webView - will be used for running OMSDK JS service and verification script
      contentUrl - containing the deep link to the ad's screen.
      customReferenceData - containing reference data specific to the integration partner.
      Returns:
      a new JAVASCRIPT context instance
      Throws:
      IllegalArgumentException - if the supplied partner is null.
      IllegalArgumentException - if the supplied webView is null.
      IllegalArgumentException - if customReferenceData is greater than 256 characters.
      See Also:
    • createNativeAdSessionContext

      public static AdSessionContext createNativeAdSessionContext(Partner partner, String omidJsScriptContent, List<VerificationScriptResource> verificationScriptResources, String contentUrl, String customReferenceData, UniversalAdId universalAdId)
      Create a new "native" ad session context.
      Parameters:
      partner - details of the integration partner responsible for the ad session
      omidJsScriptContent - containing the OM SDK JS service content to be injected into the hidden tracking web view
      verificationScriptResources - of all verification providers who expect to receive OMID event data.
      contentUrl - containing the deep link to the ad's screen.
      customReferenceData - containing reference data specific to the integration partner.
      universalAdId - details about UniversalAdId used for creative validation.
      Returns:
      a new native context instance
      Throws:
      IllegalArgumentException - if the supplied partner is null.
      IllegalArgumentException - if the supplied omidJsServiceContent is null or blank.
      IllegalArgumentException - if the supplied verificationScriptResources is null or empty.
      IllegalArgumentException - if customReferenceData is greater than 256 characters.
      See Also:
    • createNativeAdSessionContext

      public static AdSessionContext createNativeAdSessionContext(Partner partner, String omidJsScriptContent, List<VerificationScriptResource> verificationScriptResources, String contentUrl, String customReferenceData)
      Create a new "native" ad session context. This is convenience method for createNativeAdSessionContext(Partner, String, List, String, String, UniversalAdId)
    • getPartner

      public Partner getPartner()
    • getVerificationScriptResources

      public List<VerificationScriptResource> getVerificationScriptResources()
    • getInjectedResourcesMap

      public Map<String, VerificationScriptResource> getInjectedResourcesMap()
      For OM SDK internal use only.
    • getWebView

      public WebView getWebView()
    • getContentUrl

      public String getContentUrl()
    • getCustomReferenceData

      public String getCustomReferenceData()
    • getOmidJsScriptContent

      public String getOmidJsScriptContent()
    • getAdSessionContextType

      public AdSessionContextType getAdSessionContextType()
      For OM SDK internal use only.
    • getUniversalAdId

      public UniversalAdId getUniversalAdId()