OMID chapter navigation
iOS / tvOS
platformThe listings on this page are generated by scripts/gen-omid-spec.mjs from official IAB Tech Lab sources, with descriptions in the original English; see the page footer for the collection baseline.
Role & scope
OM SDK iOS exposes the interface as Objective-C classes prefixed with the Open Measurement Interface Definition (OMID) acronym: OMIDSDK handles activation and status queries, OMIDAdSession is constructed from OMIDAdSessionConfiguration and OMIDAdSessionContext, OMIDScriptInjector injects the session client into a WebView, and OMIDJavaScriptSessionService hosts the service side of JS sessions. The friendly obstruction registration API exists only on the native side.
- Platform
- iOS
- Implementation
- OM SDK iOS
- Library version
- —
- Spec version
- OMID 1.6
- Public classes
- 12
- Public members
- 74
Platform notes
- The entry class is OMIDSDK, publishing versionString, sharedInstance, active, activate and updateLastActivity; a session is created by initialising OMIDAdSession with OMIDAdSessionConfiguration and OMIDAdSessionContext via initWithConfiguration:adSessionContext:error:.
- OMIDScriptInjector injects the session client into HTML through injectScriptContent:intoHTML:error:; OMIDJavaScriptSessionService hosts the service side of JS sessions.
- The friendly obstruction registration API exists only natively: OMIDAdSession exposes addFriendlyObstruction:purpose:detailedReason:error:, removeFriendlyObstruction: and removeAllFriendlyObstructions, with the obstruction purpose declared by the OMIDFriendlyObstructionType enum (an iOS-only enum).
- OMIDUniversalAdID and OMIDVASTProperties are separate public classes on iOS, whereas the corresponding JS types are not published on the official docs site.
- The official Open-Measurement-ReferenceApp-iOS repository has not been updated since 2020-04; its README states that from iOS SDK 1.3.2 the sample source ships with the downloadable SDK. The current API surface is authoritative at docs.iabtechlab.com/omsdk-1.6/ios.
Public class listing
| Class | Client | Members | Official description |
|---|---|---|---|
| OMIDAdEventsOfficial docs ↗ | Session client | 4initWithAdSession:error:impressionOccurredWithError:loadedWithError:loadedWithVastProperties:error: | Ad event API enabling the integration partner to signal to all verification providers when key events have occurred. Only one ad events implementation can be associated with the ad session and any attempt to create multiple instances will result in an error. |
| OMIDAdSessionOfficial docs ↗ | Session client | 9configurationmainAdViewinitWithConfiguration:adSessionContext:error:startfinishaddFriendlyObstruction:purpose:detailedReason:error:removeFriendlyObstruction:removeAllFriendlyObstructionslogErrorWithType:message: | Ad session API enabling the integration partner to notify OMID of key state relating to viewability calculations. In addition to viewability this API will also notify all verification providers of key ad session lifecycle events. |
| OMIDAdSessionConfigurationOfficial docs ↗ | Session client | 6creativeTypeimpressionTypeimpressionOwnermediaEventsOwnerisolateVerificationScriptsinitWithCreativeType:impressionType:impressionOwner:mediaEventsOwner:isolateVerificationScripts:error: | The ad session configuration supplies the owner for both the impression and video events. The OM SDK JS service will use this information to help identify where the source of these events is expected to be received. |
| OMIDAdSessionContextOfficial docs ↗ | Session client | 5initinitWithPartner:webView:contentUrl:customReferenceIdentifier:error:initWithPartner:script:resources:contentUrl:customReferenceIdentifier:error:initWithPartner:script:resources:contentUrl:customReferenceIdentifier:universalAdID:error:initWithPartner:javaScriptWebView:contentUrl:customReferenceIdentifier:error: | Provides the ad session with details of the partner and whether to an HTML, JavaScript, or native session. |
| OMIDJavaScriptSessionServiceOfficial docs ↗ | Session client | 7initWithPartner:webView:isHTMLAdView:error:tearDownWithCompletion:adViewsetAdView:error:addFriendlyObstruction:purpose:detailedReason:error:removeFriendlyObstruction:removeAllFriendlyObstructions | Service supporting ad sessions managed (started/finished) via JavaScript Session Client APIs by providing native-layer measurement signals. If the JS Session Client is running in a web view, an instance of this service must be initialized with the web view before starting or finishing ad sessions using JS APIs. Only one instance of this service may be initialized at a time for a given web view; to reuse a web view the current instance must be torn down (see tearDownWithCompletion). |
| OMIDMediaEventsOfficial docs ↗ | Session client | 14initWithAdSession:error:startWithDuration:mediaPlayerVolume:firstQuartilemidpointthirdQuartilecompletepauseresumeskippedbufferStartbufferFinishvolumeChangeTo:playerStateChangeTo:adUserInteractionWithType: | This provides a complete list of native media events supported by OMID. Using this event API assumes the media player is fully responsible for communicating all media events at the appropriate times. Only one media events implementation can be associated with the ad session and any attempt to create multiple instances will result in an error. |
| OMIDPartnerOfficial docs ↗ | Session client | 4nameversionStringinitWithName:versionString:init | Details about the integration partner which will be supplied to the ad session. |
| OMIDScriptInjectorOfficial docs ↗ | Session client | 1injectScriptContent:intoHTML:error: | Utility class which enables integration partners to use a standard approach for injecting OM SDK JS into the served tag HTML content. |
| OMIDSDKOfficial docs ↗ | Session client | 5versionStringsharedInstanceactiveactivateupdateLastActivity | This application level class will be called by all integration partners to ensure OM SDK has been activated before calling any other API methods. Any attempt to use other API methods prior to activation will result in an error. Note that OM SDK may only be used on the main UI thread. Make sure you are on the main thread when you initialize the SDK, create its objects, and invoke its methods. |
| OMIDUniversalAdIDOfficial docs ↗ | Session client | 5valueidRegistryinitWithValue:idRegistry:error:newinit | Details about the UniversalAdID for the purpose of tracking ad creatives which will be supplied to the ad session. |
| OMIDVASTPropertiesOfficial docs ↗ | Session client | 8skippableskipOffsetautoPlaypositioninitWithSkipOffset:autoPlay:position:initWithAutoPlay:position:inittoJSON | This object is used to capture key VAST properties so this can be shared with all registered verification providers. |
| OMIDVerificationScriptResourceOfficial docs ↗ | Session client | 6URLvendorKeyparametersinitWithURL:vendorKey:parameters:initWithURL:init | Details about the verification provider which will be supplied to the ad session. |
Cross-platform naming
| Concept | JavaScript | iOS | Android |
|---|---|---|---|
| ad-events | AdEvents | OMIDAdEvents | AdEvents |
| ad-session | AdSession | OMIDAdSession | AdSession |
| ad-session-configuration | — | OMIDAdSessionConfiguration | AdSessionConfiguration |
| ad-session-context | — | OMIDAdSessionContext | AdSessionContext |
| context | Context | — | — |
| js-session-service | — | OMIDJavaScriptSessionService | — |
| media-events | MediaEvents | OMIDMediaEvents | MediaEvents |
| omid-version | OmidVersion | — | — |
| partner | Partner | OMIDPartner | Partner |
| script-injector | — | OMIDScriptInjector | ScriptInjector |
| sdk-entry | — | OMIDSDK | Omid |
| universal-ad-id | — | OMIDUniversalAdID | — |
| vast-properties | — | OMIDVASTProperties | VastProperties |
| verification-client | VerificationClient | — | — |
| verification-script-resource | VerificationScriptResource | OMIDVerificationScriptResource | VerificationScriptResource |
- ad-session-configurationNo JS counterpart: creativeType/impressionType are set through AdSession.setCreativeType()/setImpressionType(), and the event-owner concept (impressionOwner/mediaEventsOwner) does not exist on the JS side.
- ad-session-contextCorresponds to Context on JS: JS folds partner, verificationScriptResources, contentUrl, customReferenceData, universalAdId and the slot/video element into Context plus the AdSession constructor arguments, while the native side splits them into AdSessionContext (iOS additionally has AdSessionConfiguration).
- contextNo class of this name on iOS/Android: the JS Context is split on the native side into AdSessionContext + AdSessionConfiguration (see the ad-session-context / ad-session-configuration entries).
- js-session-servicePublished on iOS only: the JS session service built into OM SDK iOS. On Android this is handled by Omid/OmidJsBridge, with no corresponding class published on the javadoc site.
- omid-versionPublished on JS only: the top of the source file omid-version.js carries TODO(OMSDK-715) noting that the class seems unused and should be removed in the next major version, yet the JSDoc site still publishes it.
- script-injectorOMIDScriptInjector on iOS / ScriptInjector on Android: inject verification script content into an HTML creative. On the JS side the OM SDK service does this and publishes no class.
- sdk-entryOMIDSDK on iOS (+sharedInstance / -activate) and Omid on Android (activate(Context) / isActive()); there is no JS counterpart class, as the service script is loaded by the OM SDK service itself.
- universal-ad-idPublished on iOS only: the JS source has UniversalAdId (exported via packageExport onto OmidSessionClient.UniversalAdId, added in 1.5.5) but the official JSDoc site has no page for it; Android's createNativeAdSessionContext(...)/getUniversalAdId() reference the UniversalAdId type in their signatures, and the javadoc site has no such page either (verified 404).
- vast-propertiesVastProperties on JS (src/common/vast-properties.js, marked @public and listed in jsdoc.json's include list) is not published on the official JSDoc site (VastProperties.html verified 404), so js is recorded as null; AdEvents.loaded(vastProperties) therefore references a type that is undocumented on the site.
- verification-clientPublished on JS only: verification scripts (third-party measurement) always use the JS OmidVerificationClient; the native SDKs contain no verification client.
Class names for the same concept on each of the three platforms; a blank cell means that platform provides no corresponding class. On the JS side session configuration is folded into Context and the constructor arguments, while iOS / Android split it into separate configuration and context classes.