[iOS] IMA SDK - AD_BREAK_STARTED/ENDED, AD_PERIOD_STARTED/ENDED events

36 views
Skip to first unread message

Mattia Fazio

unread,
May 12, 2023, 11:29:03 AM5/12/23
to Interactive Media Ads SDK
Hi all,
I have to track when the break and pods begin and end.
I've implemented the logic with a switch case statement in the adsManager(_ adsManager: IMAAdsManager, didReceive event: IMAAdEvent) . 
As far as I can see in the enum IMAAdEvent , AD_BREAK_STARTED, AD_BREAK_ENDED, AD_PERIOD_STARTED, AD_PERIOD_ENDED event are expected but they're never being called. 

Is it possible to get those events?
I'm using GoogleAds-IMA-iOS-SDK 3.18.4 and I've tested on different iOS versions (14, 15, 16).

Many thanks,
Mattia

IMA SDK

unread,
May 12, 2023, 3:11:53 PM5/12/23
to ima...@googlegroups.com

Hi Mattia,

Thank you for reaching out to us.

Can you confirm if you already check this documentation (https://developers.google.com/interactive-media-ads/docs/sdks/ios/client-side/manual_ad_playback) for Manual Ad Break Playback in iOS? In addition to that, kindly make sure you are configuring your application to handle Ad Breaks and receive any Ad Break related events via the IMASettings for autoPlayAdBreaks (https://developers.google.com/interactive-media-ads/docs/sdks/ios/client-side/reference/Classes/IMASettings#autoplayadbreaks) method. Also, have you replicated the same behavior using our sample apps (https://developers.google.com/interactive-media-ads/docs/sdks/ios/client-side/download)? If not, we would recommend to check it and use as reference for your own integration to avoid implementation issues. If yes, kindly indicate what exact sample app did you use.

Regards,

Google Logo IMA SDK Team


ref:_00D1U1174p._5004Q2lHLpN:ref

Mattia Fazio

unread,
May 15, 2023, 12:33:40 PM5/15/23
to Interactive Media Ads SDK
Hi, thank you for the feedback.
Yes I'm following the documentation you linked and I'm also facing the same behaviour in your Swift/AdvancedExample project.

In your project I've added to the `func adsManager(_ adsManager: IMAAdsManager, didReceive event: IMAAdEvent)` method the following cases:

case IMAAdEventType.AD_BREAK_STARTED:
    print("IMAAdEventType.AD_BREAK_STARTED")
case IMAAdEventType.AD_BREAK_ENDED:
    print("IMAAdEventType.AD_BREAK_ENDED")

and the delegate never calls the adsManager method with one of these event.type values.

Thank you


IMA SDK

unread,
May 16, 2023, 4:28:44 AM5/16/23
to ima...@googlegroups.com
Hi Mattia,
 
Take note that the the SDK fires an AD_BREAK_READY event when a mid-roll has been loaded, if you implemented the Manual Ad break playback - https://developers.google.com/interactive-media-ads/docs/sdks/ios/client-side/manual_ad_playback
 
According to this document, there are two modifications required in order to implement the manual ad break. An example has been provided on the said document. Can you confirm if you made those two changes to the Swift/AdvancedExample project(https://github.com/googleads/googleads-ima-ios/tree/main/Swift/AdvancedExample)? If yes, but the error persists that you are not seeing those ad events fired, kindly provide us with the folowing:
Modified Swift/AdvancedExample project(https://github.com/googleads/googleads-ima-ios/tree/main/Swift/AdvancedExample)
Ad tag used for testing
 
If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:
 
1. Navigate to
https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=IMA+SDK&entry.460850823=5004Q00002lHLpNQAW&entry.80707362=00178660
2. Fill out all fields, and attach your file(s).
3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.
 
Looking forward to your response.
Message has been deleted
Message has been deleted

Mattia Fazio

unread,
May 22, 2023, 11:38:00 AM5/22/23
to Interactive Media Ads SDK
Hi Team,
Thank you for your feedback, sorry for the late response.

I can confirm that I've done all the suggested implementation but those event.type are not fired.
I've uploaded the .zip project using the provided link.

Here's a list of the changes I made:
  • class MainViewController, ln 96: added settings.autoPlayAdBreaks = false
  • class VideoViewController, ln 521: added IMAAdEventType.AD_BREAK_STARTED, IMAAdEventType.AD_BREAK_ENDED, IMAAdEventType.AD_PERIOD_ENDED, IMAAdEventType.AD_PERIOD_STARTED cases with a print message
Thank you for your support and help.
Mattia

Reply all
Reply to author
Forward
0 new messages