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 AdSessionContextcreateHtmlAdSessionContext(Partner partner, WebView webView, String contentUrl, String customReferenceData) Create a new "html" ad session context.static AdSessionContextcreateJavascriptAdSessionContext(Partner partner, WebView webView, String contentUrl, String customReferenceData) Create a new "javascript" ad session context.static AdSessionContextcreateNativeAdSessionContext(Partner partner, String omidJsScriptContent, List<VerificationScriptResource> verificationScriptResources, String contentUrl, String customReferenceData) Create a new "native" ad session context.static AdSessionContextcreateNativeAdSessionContext(Partner partner, String omidJsScriptContent, List<VerificationScriptResource> verificationScriptResources, String contentUrl, String customReferenceData, UniversalAdId universalAdId) Create a new "native" ad session context.AdSessionContextTypeFor OM SDK internal use only.For OM SDK internal use only.UniversalAdIdWebView
-
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, UniversalAdId universalAdId) 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.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 forcreateNativeAdSessionContext(Partner, String, List, String, String, UniversalAdId) -
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. -
getUniversalAdId
public UniversalAdId getUniversalAdId()
-