GoogleInteractiveMediaAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
IMAAdsManager
@interface IMAAdsManager : NSObject
The IMAAdsManager class is responsible for playing ads.
-
The IMAAdsManagerDelegate to notify with events during ad playback.
-
List of content time offsets at which ad breaks are scheduled.
Array of NSNumber double values in seconds.
Empty NSArray for single ads or if no ad breaks are scheduled.
Declaration
Swift
var adCuePoints: [Any] { get }
Objective-C
@property (nonatomic, copy, readonly) NSArray *_Nonnull adCuePoints;
-
Groups various properties about the linear ad playback.
Declaration
Objective-C
@property (nonatomic, readonly) id<IMAAdPlaybackInfo> _Nonnull adPlaybackInfo;
-
Set and get the volume for the current ad. From 0 (muted) to 1 (loudest). This volume is
relative to device volume, not absolute. Default value is 1.
Declaration
Swift
var volume: Float { get set }
Objective-C
@property (nonatomic) float volume;
-
Initializes and loads the ad.
Parameters
adsRenderingSettings
|
the IMAAdsRenderingSettings. Pass in to influence ad rendering.
Use nil to default to standard rendering.
|
-
Starts advertisement playback.
Declaration
Objective-C
- (void)start;
-
Declaration
Objective-C
- (void)pause;
-
Resumes the advertisement.
Declaration
Objective-C
- (void)resume;
-
Skips the advertisement if the ad is skippable and the skip offset has been reached.
IMAAdsManager.skip()
only skips ads if IMA does not render the ‘Skip ad’ button.
Declaration
Objective-C
- (void)skip;
-
Causes the ads manager to stop the ad and clean its internal state.
Declaration
Objective-C
- (void)destroy;
-
If an ad break is currently playing, discard it and resume content.
Otherwise, ignore the next scheduled ad break.
Declaration
Swift
func discardAdBreak()
Objective-C
- (void)discardAdBreak;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[null,null,["Last updated 2025-08-20 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eIMAAdsManager\u003c/code\u003e class is the primary tool for managing and playing ads within your content.\u003c/p\u003e\n"],["\u003cp\u003eIt provides control over ad playback, including starting, pausing, resuming, skipping, and destroying ads.\u003c/p\u003e\n"],["\u003cp\u003eYou can adjust the ad volume relative to the device volume and access information about ad playback.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eIMAAdsManager\u003c/code\u003e offers methods to discard ad breaks and customize ad rendering settings.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can track ad events by setting the \u003ccode\u003edelegate\u003c/code\u003e property to receive notifications through the \u003ccode\u003eIMAAdsManagerDelegate\u003c/code\u003e protocol.\u003c/p\u003e\n"]]],["The `IMAAdsManager` class manages ad playback, offering methods to control the ad lifecycle. Key actions include `initializeWithAdsRenderingSettings:` for loading ads, `start` to begin playback, `pause` and `resume` for controlling playback state, `skip` to bypass skippable ads, `destroy` to stop ads and clear internal state, and `discardAdBreak` to skip an ongoing or upcoming ad break. It utilizes a delegate for event notifications, and provides information like `adCuePoints` and `adPlaybackInfo`. Volume can be set with `volume`.\n"],null,["# GoogleInteractiveMediaAds Framework Reference\n\nIMAAdsManager\n=============\n\n @interface IMAAdsManager : NSObject\n\nThe IMAAdsManager class is responsible for playing ads.\n- `\n ``\n ``\n `\n\n ### [delegate](#/c:objc(cs)IMAAdsManager(py)delegate)\n\n `\n ` \n The IMAAdsManagerDelegate to notify with events during ad playback. \n\n #### Declaration\n\n Swift \n\n weak var delegate: (any NSObjectProtocol & ../Protocols/IMAAdsManagerDelegate.html)? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) NSObject\u003c../Protocols/IMAAdsManagerDelegate.html\u003e *delegate;\n\n- `\n ``\n ``\n `\n\n ### [adCuePoints](#/c:objc(cs)IMAAdsManager(py)adCuePoints)\n\n `\n ` \n List of content time offsets at which ad breaks are scheduled.\n Array of NSNumber double values in seconds.\n Empty NSArray for single ads or if no ad breaks are scheduled. \n\n #### Declaration\n\n Swift \n\n var adCuePoints: [Any] { get }\n\n Objective-C \n\n @property (nonatomic, copy, readonly) NSArray *_Nonnull adCuePoints;\n\n- `\n ``\n ``\n `\n\n ### [adPlaybackInfo](#/c:objc(cs)IMAAdsManager(py)adPlaybackInfo)\n\n `\n ` \n Groups various properties about the linear ad playback. \n\n #### Declaration\n\n Swift \n\n var adPlaybackInfo: any ../Protocols/IMAAdPlaybackInfo.html { get }\n\n Objective-C \n\n @property (nonatomic, readonly) id\u003c../Protocols/IMAAdPlaybackInfo.html\u003e _Nonnull adPlaybackInfo;\n\n- `\n ``\n ``\n `\n\n ### [volume](#/c:objc(cs)IMAAdsManager(py)volume)\n\n `\n ` \n Set and get the volume for the current ad. From 0 (muted) to 1 (loudest). This volume is\n relative to device volume, not absolute. Default value is 1. \n\n #### Declaration\n\n Swift \n\n var volume: Float { get set }\n\n Objective-C \n\n @property (nonatomic) float volume;\n\n- `\n ``\n ``\n `\n\n ### [-initializeWithAdsRenderingSettings:](#/c:objc(cs)IMAAdsManager(im)initializeWithAdsRenderingSettings:)\n\n `\n ` \n Initializes and loads the ad. \n\n #### Declaration\n\n Swift \n\n func initialize(with adsRenderingSettings: ../Classes/IMAAdsRenderingSettings.html?)\n\n Objective-C \n\n - (void)initializeWithAdsRenderingSettings:\n (nullable ../Classes/IMAAdsRenderingSettings.html *)adsRenderingSettings;\n\n #### Parameters\n\n |------------------------------|-----------------------------------------------------------------------------------------------------------|\n | ` `*adsRenderingSettings*` ` | the IMAAdsRenderingSettings. Pass in to influence ad rendering. Use nil to default to standard rendering. |\n\n- `\n ``\n ``\n `\n\n ### [-start](#/c:objc(cs)IMAAdsManager(im)start)\n\n `\n ` \n Starts advertisement playback. \n\n #### Declaration\n\n Swift \n\n func start()\n\n Objective-C \n\n - (void)start;\n\n- `\n ``\n ``\n `\n\n ### [-pause](#/c:objc(cs)IMAAdsManager(im)pause)\n\n `\n ` \n Pauses advertisement. \n\n #### Declaration\n\n Swift \n\n func pause()\n\n Objective-C \n\n - (void)pause;\n\n- `\n ``\n ``\n `\n\n ### [-resume](#/c:objc(cs)IMAAdsManager(im)resume)\n\n `\n ` \n Resumes the advertisement. \n\n #### Declaration\n\n Swift \n\n func resume()\n\n Objective-C \n\n - (void)resume;\n\n- `\n ``\n ``\n `\n\n ### [-skip](#/c:objc(cs)IMAAdsManager(im)skip)\n\n `\n ` \n Skips the advertisement if the ad is skippable and the skip offset has been reached.\n `IMAAdsManager.skip()` only skips ads if IMA does not render the 'Skip ad' button. \n\n #### Declaration\n\n Swift \n\n func skip()\n\n Objective-C \n\n - (void)skip;\n\n- `\n ``\n ``\n `\n\n ### [-destroy](#/c:objc(cs)IMAAdsManager(im)destroy)\n\n `\n ` \n Causes the ads manager to stop the ad and clean its internal state. \n\n #### Declaration\n\n Swift \n\n func destroy()\n\n Objective-C \n\n - (void)destroy;\n\n- `\n ``\n ``\n `\n\n ### [-discardAdBreak](#/c:objc(cs)IMAAdsManager(im)discardAdBreak)\n\n `\n ` \n If an ad break is currently playing, discard it and resume content.\n Otherwise, ignore the next scheduled ad break. \n\n #### Declaration\n\n Swift \n\n func discardAdBreak()\n\n Objective-C \n\n - (void)discardAdBreak;"]]