OM SDK 1.4 is a minor update. It adds support for some key new use cases for OMID 1.4 while allowing scripts using OMID 1.2 and 1.3 to run correctly. Integrations (apps and SDKs) using OM SDK will only need to make code changes if adding support for tvOS.
Summary of the new features added in OM SDK 1.4:
Open Measurement SDK follows semantic versioning for the OMID JavaScript session and verification interfaces. This means that verification scripts and session scripts for a major version (1.x) will run on any integration also running OM SDK 1.x. (Of course, features introduced in later minor versions of OM SDK will not be available when running on an integration using an earlier minor version.)
The native-layer integration APIs for Open Measurement SDK don’t follow semantic versioning. Instead, integration APIs are added or deprecated at minor releases and phased out gradually. This gives integrators time to import OM SDK with the new API, develop against it, and test their changes. This process takes at least 4 OM SDK patch releases (2 months):
@deprecated
in Java, __attribute((deprecated))
in Objective-C). This stage also lasts for 2 patch releases. It will apply to OM SDK 1.4.2 and 1.4.3.Apps that embed OM SDK can be out in the field for a long time. Users can be slow to download new versions of apps, and the app developers may choose to not update apps. So apps by a single OM SDK integrator can have a mix of versions.
That means that the OM SDK JavaScript service needs to be compatible with both old and current versions of the native layer, but not vice versa.
So an integration must ensure that they deploy new versions of the JavaScript service (omsdk-v1.js) before they deploy new versions of the native SDKs.
The OM SDK has been expanded to support tvOS (Apple TV).
Previous versions of the OM SDK recommended activating the OM SDK at any time before the ad session, via the following code:
[[OMIDSDK sharedInstance] activate]
To allow for the OM SDK to detect signs of activity, the SDK has been modified to detect app activation (foregrounding) outside of an ad session. This is especially important on tvOS, where extended periods of no activity is a concern. Please activate the SDK as early as possible in the app’s lifecycle, ideally in the AppDelegate like so:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[OMIDSDK sharedInstance] activate]
}
Additionally, please notify the OM SDK when a user interacts with the app.
[[OMIDSDK sharedInstance] updateLastActivity]
Note, rather than instrument all user interactions, identify those key interactions leading up to the ad impression prior to starting an ad session. Some examples are navigating to the view which displays the ad, selecting content which includes the ad, video pause/resume interactions prior to displaying the ad, and user response to an “are you still watching?” prompt.
Note, avoid instrumenting ambiguous events that can also be triggered programatically. Consider the following example:
- (void)buttonTapped:(id)sender {
// Instrument here, if `[MyViewController buttonTapped]` is exclusively triggered by the user tapping on the button.
[[OMIDSDK sharedInstance] updateLastActivity];
[self doSomething];
}
- (void)doSomething {
// Don't instrument here as this method might also get triggered in other code paths.
}
- (void)anotherCodepath {
[self doSomething];
}
Per the semantic versioning policy, verification scripts using only OMID 1.3 features do not need any modification to run on integrations using OM SDK 1.4. For a verification script, the changes in OM SDK 1.4 are purely additive — they will receive the same data as in 1.3, plus some additional data that 1.4 provides. Nonetheless, verification providers are encouraged to use OMID 1.4 data when present.
Verification scripts will be receiving a new signal for the device category on the Context object on sessionStart events, covering if the device is a mobile, desktop or CTV device. For iOS and tvOS, this will be the same information as the operating system.
Verification scripts should be aware that when the screen is detected as off, the reason for no viewability will be reported as no output device detected (‘noOutputDevice’), and as the app is backgrounded (‘backgrounded’). This is to align CTV reporting with the current behavior for mobile devices.
Additionally, the timestamp of last activity will be reported on sessionStart events as a singular timestamp.