OMIDAdSessionContext

Objective-C

@interface OMIDAdSessionContext : NSObject

Swift

class OMIDAdSessionContext : NSObject

Provides the ad session with details of the partner and whether to an HTML, JavaScript, or native session.

  • Unavailable

    Declaration

    Objective-C

    - (null_unspecified instancetype)init NS_UNAVAILABLE;
  • Initializes a new ad session context providing reference to partner and web view where the OM SDK JavaScript service has been injected.

    Calling this method will set the ad session type to html.

    NOTE: any attempt to create a new ad session will fail if OM SDK has not been activated (see {@link OMIDSDK} class for more information).

    See

    OMIDSDK

    Declaration

    Objective-C

    - (nullable instancetype)initWithPartner:(nonnull OMIDPartner *)partner
                                     webView:(nonnull WKWebView *)webView
                                  contentUrl:(nullable NSString *)contentUrl
                   customReferenceIdentifier:
                       (nullable NSString *)customReferenceIdentifier
                                       error:(NSError *_Nullable *_Nullable)error;

    Swift

    init(partner: OMIDPartner, webView: WKWebView, contentUrl: String?, customReferenceIdentifier: String?) throws

    Return Value

    A new HTML context instance. Returns nil if OM SDK has not been activated or if any of the parameters are nil.

  • Initializes a new ad session context providing reference to partner and a list of script resources which should be managed by OMID.

    Calling this method will set the ad session type to native.

    NOTE: any attempt to create a new ad session will fail if OMID has not been activated (see {@link OMIDSDK} class for more information).

    See

    OMIDSDK

    Declaration

    Objective-C

    - (nullable instancetype)
                  initWithPartner:(nonnull OMIDPartner *)partner
                           script:(nonnull NSString *)script
                        resources:
                            (nonnull NSArray<OMIDVerificationScriptResource *> *)
                                resources
                       contentUrl:(nullable NSString *)contentUrl
        customReferenceIdentifier:(nullable NSString *)customReferenceIdentifier
                            error:(NSError *_Nullable *_Nullable)error;

    Swift

    init(partner: OMIDPartner, script: String, resources: [OMIDVerificationScriptResource], contentUrl: String?, customReferenceIdentifier: String?) throws

    Return Value

    A new native context instance. Returns nil if OMID has not been activated or if any of the parameters are invalid.

  • Initializes a new ad session context providing reference to partner and web view where OM SDK JavaScript service has been injected.

    Calling this method will set the ad session type to javascript.

    NOTE: any attempt to create a new ad session will fail if OMID has not been activated (see {@link OMIDSDK} class for more information).

    See

    OMIDSDK

    Declaration

    Objective-C

    - (nullable instancetype)initWithPartner:(nonnull OMIDPartner *)partner
                           javaScriptWebView:(nonnull WKWebView *)webView
                                  contentUrl:(nullable NSString *)contentUrl
                   customReferenceIdentifier:
                       (nullable NSString *)customReferenceIdentifier
                                       error:(NSError *_Nullable *_Nullable)error;

    Swift

    init(partner: OMIDPartner, javaScriptWebView webView: WKWebView, contentUrl: String?, customReferenceIdentifier: String?) throws

    Return Value

    A new JavaScript context instance. Returns nil if OM SDK has not been activated or if any of the parameters are invalid.