OMIDSDK
Objective-C
@interface OMIDSDK : NSObject
Swift
class OMIDSDK : NSObject
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.
-
The current semantic version of the integrated OMID library.
Declaration
Objective-C
+ (nonnull NSString *)versionString;
Swift
class func versionString() -> String
-
Shared OMIDSDK instance.
Declaration
Objective-C
@property (class, readonly) NS_SWIFT_NAME(shared) OMIDSDK *sharedInstance;
Swift
class var shared: OMIDSDK { get }
-
A Boolean value indicating whether OM SDK has been activated.
@discussion Check that OM SDK is active prior to creating any ad sessions.
Declaration
Objective-C
@property (readonly, getter=isActive) BOOL active;
Swift
var isActive: Bool { get }
-
Activate OM SDK before calling other API methods.
@discussion Activation sets up the OM SDK environment. In CTV apps (running tvOS),
activate
should be called on launch in order to capture a “last activity” timestamp on launch and each time the user foregrounds the app).Declaration
Objective-C
- (BOOL)activate;
Swift
func activate() -> Bool
Return Value
Boolean indicating success.
-
Update the last activity time After activating OM SDK in CTV apps, refresh the “last activity” timestamp in response to user input prior to starting an ad session.
Declaration
Objective-C
- (void)updateLastActivity;
Swift
func updateLastActivity()