Stay organized with collections Save and categorize content based on your preferences.
IMAAdsLoader
@interfaceIMAAdsLoader:NSObject
The IMAAdsLoader class allows the requesting of ads from the ad server. Use the delegate to receive the loaded ads or loading error in case of failure.
Initializes an IMAAdsLoader with specific settings. The loader takes 1-2 seconds to setup once initialized, therefore reusing a single instance of the ads loader is encouraged to minimize ad request times.
Initializes the IMAAdsLoader with default settings. The loader takes 1-2 seconds to setup once initialized, therefore reusing a single instance of the ads loader is encouraged to minimize ad request times.
Request ads from the ad server. The loader takes 1-2 seconds to setup on init and become ready to make ad requests. So reusing the same IMAAdsLoader instance is encouraged when making ad requests in order to minimize ad request times.
Request a stream with ads inserted dynamically. Reusing the same IMAAdsLoader instance is encouraged when making stream requests in order to minimize stream request latency.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-14 UTC."],[[["\u003cp\u003eThe IMAAdsLoader class is used to request ads from the ad server and utilizes a delegate to handle ad responses and errors.\u003c/p\u003e\n"],["\u003cp\u003eReusing a single IMAAdsLoader instance is recommended to optimize ad request times and minimize latency.\u003c/p\u003e\n"],["\u003cp\u003eIt supports requesting both standard ads and dynamic ad insertion within streams using \u003ccode\u003erequestAdsWithRequest\u003c/code\u003e and \u003ccode\u003erequestStreamWithRequest\u003c/code\u003e respectively.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can signal content completion with \u003ccode\u003econtentComplete\u003c/code\u003e to trigger post-roll playback, if any.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esettings\u003c/code\u003e property allows for SDK-wide configurations, while \u003ccode\u003edelegate\u003c/code\u003e manages ad events.\u003c/p\u003e\n"]]],[],null,["IMAAdsLoader \n\n @interface IMAAdsLoader : NSObject\n\nThe IMAAdsLoader class allows the requesting of ads from the ad server.\nUse the delegate to receive the loaded ads or loading error\nin case of failure.\n- `\n ``\n ``\n `\n\n [settings](#/c:objc(cs)IMAAdsLoader(py)settings)`\n ` \n SDK-wide settings. Note that certain settings will only be evaluated during initialization of\n the adsLoader. \n\n Declaration \n Swift \n\n @NSCopying var settings: ../Classes/IMASettings.html { get }\n\n Objective-C \n\n @property (nonatomic, copy, readonly) ../Classes/IMASettings.html *_Nonnull settings;\n\n- `\n ``\n ``\n `\n\n [delegate](#/c:objc(cs)IMAAdsLoader(py)delegate)`\n ` \n Delegate that receives IMAAdsLoaderDelegate callbacks. \n\n Declaration \n Swift \n\n weak var delegate: (any ../Protocols/IMAAdsLoaderDelegate.html)? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) id\u003c../Protocols/IMAAdsLoaderDelegate.html\u003e delegate;\n\n- `\n ``\n ``\n `\n\n [+sdkVersion](#/c:objc(cs)IMAAdsLoader(cm)sdkVersion)`\n ` \n Returns the SDK version. \n\n Declaration \n Swift \n\n class func sdkVersion() -\u003e String\n\n Objective-C \n\n + (nonnull NSString *)sdkVersion;\n\n Return Value\n\n the SDK version\n- `\n ``\n ``\n `\n\n [-initWithSettings:](#/c:objc(cs)IMAAdsLoader(im)initWithSettings:)`\n ` \n Initializes an IMAAdsLoader with specific settings. The loader takes 1-2 seconds to setup once\n initialized, therefore reusing a single instance of the ads loader is encouraged to minimize ad\n request times. \n\n Declaration \n Swift \n\n init(settings: ../Classes/IMASettings.html?)\n\n Objective-C \n\n - (nonnull instancetype)initWithSettings:(nullable ../Classes/IMASettings.html *)settings;\n\n Parameters\n\n |------------------|-----------------------------------------------------------------------|\n | ` `*settings*` ` | the IMASettings to use for SDK wide settings. Uses defaults when nil. |\n\n Return Value\n\n an IMAAdsLoader instance with given IMASettings\n- `\n ``\n ``\n `\n\n [-init](#/c:objc(cs)IMAAdsLoader(im)init)`\n ` \n Initializes the IMAAdsLoader with default settings. The loader takes 1-2 seconds to setup once\n initialized, therefore reusing a single instance of the ads loader is encouraged to minimize ad\n request times. \n\n Declaration \n Swift \n\n init()\n\n Objective-C \n\n - (nonnull instancetype)init;\n\n Return Value\n\n an IMAAdsLoader instance with default IMASettings\n- `\n ``\n ``\n `\n\n [-requestAdsWithRequest:](#/c:objc(cs)IMAAdsLoader(im)requestAdsWithRequest:)`\n ` \n Request ads from the ad server. The loader takes 1-2 seconds to setup on init and become ready\n to make ad requests. So reusing the same IMAAdsLoader instance is encouraged when making ad\n requests in order to minimize ad request times. \n\n Declaration \n Swift \n\n func requestAds(with request: ../Classes/IMAAdsRequest.html)\n\n Objective-C \n\n - (void)requestAdsWithRequest:(nonnull ../Classes/IMAAdsRequest.html *)request;\n\n Parameters\n\n |-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*request*` ` | the IMAAdsRequest. If it was created for use with Picture-in-Picture, this IMAAdsLoader instance's IMASettings must have backround playback enabled |\n\n- `\n ``\n ``\n `\n\n [-requestStreamWithRequest:](#/c:objc(cs)IMAAdsLoader(im)requestStreamWithRequest:)`\n ` \n Request a stream with ads inserted dynamically. Reusing the same IMAAdsLoader instance is\n encouraged when making stream requests in order to minimize stream request latency. \n\n Declaration \n Swift \n\n func requestStream(with request: ../Classes/IMAStreamRequest.html)\n\n Objective-C \n\n - (void)requestStreamWithRequest:(nonnull ../Classes/IMAStreamRequest.html *)request;\n\n Parameters\n\n |-----------------|--------------------|\n | ` `*request*` ` | the stream request |\n\n- `\n ``\n ``\n `\n\n [-contentComplete](#/c:objc(cs)IMAAdsLoader(im)contentComplete)`\n ` \n Signal to the SDK that the content has completed. The SDK will play\n post-rolls at this time, if any are scheduled. \n\n Declaration \n Swift \n\n func contentComplete()\n\n Objective-C \n\n - (void)contentComplete;"]]