GoogleInteractiveMediaAds Framework Reference

IMAAdsManagerDelegate

@protocol IMAAdsManagerDelegate

A callback protocol for IMAAdsManager.

  • Called when there is an IMAAdEvent.

    Declaration

    Swift

    func adsManager(_ adsManager: IMAAdsManager, didReceive event: IMAAdEvent)

    Objective-C

    - (void)adsManager:(nonnull IMAAdsManager *)adsManager
        didReceiveAdEvent:(nonnull IMAAdEvent *)event;

    Parameters

    adsManager

    the IMAAdsManager receiving the event

    event

    the IMAAdEvent received

  • Called when there was an error playing the ad. Log the error and resume playing content.

    Declaration

    Swift

    func adsManager(_ adsManager: IMAAdsManager, didReceive error: IMAAdError)

    Objective-C

    - (void)adsManager:(nonnull IMAAdsManager *)adsManager
        didReceiveAdError:(nonnull IMAAdError *)error;

    Parameters

    adsManager

    the IMAAdsManager that errored

    error

    the IMAAdError received

  • Called when an ad is ready to play. The implementing code should pause the content playback and prepare the UI for ad playback.

    Declaration

    Swift

    func adsManagerDidRequestContentPause(_ adsManager: IMAAdsManager)

    Objective-C

    - (void)adsManagerDidRequestContentPause:(nonnull IMAAdsManager *)adsManager;

    Parameters

    adsManager

    the IMAAdsManager requesting content pause

  • Called when an ad has finished or an error occurred during the playback. The implementing code should resume the content playback.

    Declaration

    Swift

    func adsManagerDidRequestContentResume(_ adsManager: IMAAdsManager)

    Objective-C

    - (void)adsManagerDidRequestContentResume:(nonnull IMAAdsManager *)adsManager;

    Parameters

    adsManager

    the IMAAdsManager requesting content resume

  • Called every 200ms to provide time updates for the current ad.

    Declaration

    Swift

    optional func adsManager(_ adsManager: IMAAdsManager, adDidProgressToTime mediaTime: TimeInterval, totalTime: TimeInterval)

    Objective-C

    - (void)adsManager:(nonnull IMAAdsManager *)adsManager
        adDidProgressToTime:(NSTimeInterval)mediaTime
                  totalTime:(NSTimeInterval)totalTime;

    Parameters

    adsManager

    the IMAAdsManager tracking ad playback

    mediaTime

    the current media time in seconds

    totalTime

    the total media length in seconds

  • Called when the current ad is sufficiently buffered and playback is likely to keep up.

    Declaration

    Swift

    optional func adsManagerAdPlaybackReady(_ adsManager: IMAAdsManager)

    Objective-C

    - (void)adsManagerAdPlaybackReady:(nonnull IMAAdsManager *)adsManager;

    Parameters

    adsManager

    the IMAAdsManager with ad playback ready

  • Called when the current ad media buffer is empty and playback did stall.

    Declaration

    Swift

    optional func adsManagerAdDidStartBuffering(_ adsManager: IMAAdsManager)

    Objective-C

    - (void)adsManagerAdDidStartBuffering:(nonnull IMAAdsManager *)adsManager;

    Parameters

    adsManager

    the IMAAdsManager tracking the stalled ad

  • Called as the current ad media buffers.

    Declaration

    Swift

    optional func adsManager(_ adsManager: IMAAdsManager, adDidBufferToMediaTime mediaTime: TimeInterval)

    Objective-C

    - (void)adsManager:(nonnull IMAAdsManager *)adsManager
        adDidBufferToMediaTime:(NSTimeInterval)mediaTime;

    Parameters

    adsManager

    the IMAAdsManager tracking the ad’s media buffer

    mediaTime

    the current buffered media time in seconds