Object AdSessionContextFactory
-
- All Implemented Interfaces:
public class AdSessionContextFactoryFactory class for creating OMID AdSessionContext instances for different ad formats.
This factory provides methods to create ad session contexts for both HTML-based (web) and native ad formats. It automatically configures the OMID Partner information using the SDK version and partner configuration from the ad config.
The factory handles the creation of appropriate context types based on the ad format:
HTML contexts for web-based ads using WebView
Native contexts for native ads with verification script resources
Partner information is automatically derived from the SDK configuration and includes the partner name and a formatted version string combining platform and SDK version.
-
-
Field Summary
Fields Modifier and Type Field Description public final static AdSessionContextFactoryINSTANCE
-
Method Summary
Modifier and Type Method Description final AdSessionContextcreateHtmlAdSessionContext(WebView adView, String contentUrl, String customReferenceData)Creates an HTML AdSessionContext for web-based ads. final AdSessionContextcreateNativeAdSessionContext(String omsdkScript, List<OmidTracker> omidTrackers, Map<String, String> macros, String contentUrl, String customReferenceData)Creates a Native AdSessionContext from AdVerifications. -
-
Method Detail
-
createHtmlAdSessionContext
final AdSessionContext createHtmlAdSessionContext(WebView adView, String contentUrl, String customReferenceData)
Creates an HTML AdSessionContext for web-based ads.
- Parameters:
adView- The WebView used for the ad.contentUrl- The URL of the ad content.customReferenceData- Custom reference data (can be an empty string).- Returns:
The created AdSessionContext, or null if creation fails.
-
createNativeAdSessionContext
final AdSessionContext createNativeAdSessionContext(String omsdkScript, List<OmidTracker> omidTrackers, Map<String, String> macros, String contentUrl, String customReferenceData)
Creates a Native AdSessionContext from AdVerifications.
- Parameters:
omsdkScript- The JSLibraryManager instance.omidTrackers- The VAST AdVerification node.contentUrl- The URL of the ad content.customReferenceData- Custom reference data (can be an empty string).- Returns:
The created AdSessionContext, or null if creation fails.
-
-
-
-