[iOS] add more controls to the AD UI

113 views
Skip to first unread message

Mohammed Alnajdi

unread,
Jan 23, 2023, 9:38:46 AM1/23/23
to Interactive Media Ads SDK
hey team,

I wanted to add a pause button to be shown in the middle of the player while ads are running and only when the ad is tapped without violating https://developers.google.com/interactive-media-ads/docs/sdks/ios/client-side/omsdk,

Is there a way to do this or an example in iOS swift ?

Thanks a lot.

IMA SDK

unread,
Jan 23, 2023, 2:17:06 PM1/23/23
to mohd...@gmail.com, ima...@googlegroups.com
Hi Mohammed,

We do have very limited support we can offer for customizing ad ui elements, such as showing/hiding the ad attribution and countdown timer. You may check it here.

Regards,
Google Logo
Teejay Wennie
IMA SDK Team
 


ref:_00D1U1174p._5004Q2iMciK:ref

Mohammed Alnajdi

unread,
Jan 24, 2023, 10:27:50 AM1/24/23
to Interactive Media Ads SDK
Hi Hi
there must be a way, how can we enable users to pause the ad while watching it if they got busy with something ?

Thanks.

IMA SDK

unread,
Jan 24, 2023, 2:15:43 PM1/24/23
to mohd...@gmail.com, ima...@googlegroups.com
Hi Mohammed,

I do understand your concern. However, pushing this functionality can cause accidental clicks which is a policy violation, I could still submit this as a feature request to the team. Before I can proceed, could you please provide your business use case (and benefit) to the said feature?

Mohammed Alnajdi

unread,
Jan 24, 2023, 2:23:31 PM1/24/23
to Interactive Media Ads SDK
Hey thanks for the reply,

How come this might be a policy violation when the YouTube app does it and more ?
When an Ad is running the YouTube player for that Ad shows a play/pause button in the middle. I wanna do the same thing.

Thanks.

IMA SDK

unread,
Jan 24, 2023, 11:52:15 PM1/24/23
to mohd...@gmail.com, ima...@googlegroups.com

Hello,

 

Michael here and I work along with Teejay.

 

The iOS DAI supports OM SDK which is the same with the one your shared for iOS client side link in your first message. In which, IMA SDK introduces an API for registering these overlays with the Open Measurement SDK. Having said that, I believe the best way to achieve your use case is to follow the registering of video controls overlay obstructions. This way it will be considered as friendly obstruction and will not violate anything from both IMA and OM SDK. A sample can be found at the near bottom of the documentation, posting snippet below.
 

UIView *myTransparentTapOverlay = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 250)];
UIButton *myPauseButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 50, 10)];
// Substitute "myTransparentTapOverlay" and "myPauseButton" with the elements
// you want to register as video controls overlays.
// Make sure to register before ad playback starts.
IMAFriendlyObstruction *overlayObstruction =
      [[IMAFriendlyObstruction alloc] initWithView:myTransparentTapOverlay
                                           purpose:IMAFriendlyObstructionPurposeNotVisible
                                    detailedReason:@"This overlay is transparent and does not impact viewability."];
IMAFriendlyObstruction *pauseButtonObstruction =
      [[IMAFriendlyObstruction alloc] initWithView:myPauseButton
                                           purpose:IMAFriendlyObstructionPurposeMediaControls
                                    detailedReason:@"This is the video player's pause button."];

[displayContainer registerFriendlyObstruction:overlayObstruction];
[displayContainer registerFriendlyObstruction:pauseButtonObstruction];


Let us know if you have further question in the above information.

Regards,

Google Logo
Michael Angelo
IMA SDK Team
 


ref:_00D1U1174p._5004Q2iMciK:ref

Mohammed Alnajdi

unread,
Jan 25, 2023, 1:32:57 AM1/25/23
to Interactive Media Ads SDK
Hey team,

As you mentioned i did link the right docs in my first message but sadly the example is only in objective-c and i would love if you can:

1. provide me a working example with the basic example app in github in Swift.
2. maybe update the docs to include a swift example as well.

Keep in mind i did try to convert it my self but i was not able to get it to work.

Thanks a lot and i really appreciate your support.

IMA SDK

unread,
Jan 25, 2023, 10:52:03 AM1/25/23
to mohd...@gmail.com, ima...@googlegroups.com
Hi Mohammed,

Thank you for getting back to us. Allow me to submit your request to the team. In the meantime, kindly keep an eye on our developer doc or our sample app for update regarding this.

Regards,
Google Logo
Teejay Wennie
IMA SDK Team
 


ref:_00D1U1174p._5004Q2iMciK:ref

Mohammed Alnajdi

unread,
Jan 26, 2023, 4:16:18 AM1/26/23
to Interactive Media Ads SDK
Thanks a lot, how long do you think this might take ?

IMA SDK

unread,
Jan 26, 2023, 12:19:31 PM1/26/23
to mohd...@gmail.com, ima...@googlegroups.com
Hi Mohammed,

I'm afraid that we cannot provide a definite timeline on when this will be available. What I can recommend at this point is to keep an eye on our developer doc or our sample app for update regarding this.

IMA SDK

unread,
Feb 15, 2023, 9:55:48 AM2/15/23
to mohd...@gmail.com, ima...@googlegroups.com

Hello Mohammed,

This is Jackson from the IMA SDK team. We recently found an error in our OM SDK guide, which is not updated (please see the link ).

The change is can be see in the 'Key point', and is:

The 'detailedReason' string used when creating a IMAFriendlyObstruction must follow the IAB standard by:

  • Being 50 characters or less.
  • Only contain characters A-z, 0-9, or spaces
  • The string can be nil. 
Previously our example snippet violated this standard. I understand that this is not a swift example, but may explain why your swift implementation was having issue.

Please let me know if you have any questions.

Thank you
Jackson
IMA SDK team

ref:_00D1U1174p._5004Q2iMciK:ref

Mohammed Alnajdi

unread,
Feb 15, 2023, 3:40:10 PM2/15/23
to Interactive Media Ads SDK
Thanks a lot. I will try it and get back to you
Reply all
Reply to author
Forward
0 new messages