Package com.iab.omid.library.adsession
Class AdSessionContext
java.lang.Object
com.iab.omid.library.adsession.AdSessionContext
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 Summary
Modifier and TypeMethodDescriptionstatic AdSessionContext
createHtmlAdSessionContext
(Partner partner, WebView webView, String contentUrl, String customReferenceData) Create a new "html" ad session context.static AdSessionContext
createJavascriptAdSessionContext
(Partner partner, WebView webView, String contentUrl, String customReferenceData) Create a new "javascript" ad session context.static AdSessionContext
createNativeAdSessionContext
(Partner partner, String omidJsScriptContent, List<VerificationScriptResource> verificationScriptResources, String contentUrl, String customReferenceData) Create a new "native" ad session context.AdSessionContextType
For OM SDK internal use only.For OM SDK internal use only.WebView
-
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 sessionwebView
- responsible for serving the ad contentcontentUrl
- 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 sessionwebView
- will be used for running OMSDK JS service and verification scriptcontentUrl
- 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) Create a new "native" ad session context.- Parameters:
partner
- details of the integration partner responsible for the ad sessionomidJsScriptContent
- containing the OM SDK JS service content to be injected into the hidden tracking web viewverificationScriptResources
- 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.- 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:
-
getPartner
-
getVerificationScriptResources
-
getInjectedResourcesMap
For OM SDK internal use only. -
getWebView
public WebView getWebView() -
getContentUrl
-
getCustomReferenceData
-
getOmidJsScriptContent
-
getAdSessionContextType
public AdSessionContextType getAdSessionContextType()For OM SDK internal use only.
-