GoogleInteractiveMediaAds Framework Reference

IMAAdsManager

@interface IMAAdsManager : NSObject

The IMAAdsManager class is responsible for playing ads.

  • The IMAAdsManagerDelegate to notify with events during ad playback.

    Declaration

    Swift

    weak var delegate: (any NSObjectProtocol & IMAAdsManagerDelegate)? { get set }

    Objective-C

    @property (nonatomic, weak, nullable) NSObject<IMAAdsManagerDelegate> *delegate;
  • 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

    Swift

    var adPlaybackInfo: any IMAAdPlaybackInfo { get }

    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.

    Declaration

    Swift

    func initialize(with adsRenderingSettings: IMAAdsRenderingSettings?)

    Objective-C

    - (void)initializeWithAdsRenderingSettings:
        (nullable IMAAdsRenderingSettings *)adsRenderingSettings;

    Parameters

    adsRenderingSettings

    the IMAAdsRenderingSettings. Pass in to influence ad rendering. Use nil to default to standard rendering.

  • Starts advertisement playback.

    Declaration

    Swift

    func start()

    Objective-C

    - (void)start;
  • Pauses advertisement.

    Declaration

    Swift

    func pause()

    Objective-C

    - (void)pause;
  • Resumes the advertisement.

    Declaration

    Swift

    func resume()

    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

    Swift

    func skip()

    Objective-C

    - (void)skip;
  • Causes the ads manager to stop the ad and clean its internal state.

    Declaration

    Swift

    func destroy()

    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;