Unity ios banner position on iPhone X

908 views
Skip to first unread message

David Appledore

unread,
Nov 17, 2017, 4:21:08 AM11/17/17
to Google Mobile Ads SDK Developers
Hello,
Im trying to position the banner above the home indicator on the bottom of the iPhone X in portrait, im using the safe area but the banner does not appear where expected. I found that dividing the safe area maxY by 3 gets it in the right positon not sure why. Landscape appears where expected.
Using Unity 2017.2 , Xcode 9.2 beta , iPhone X 11.2 simulator, latest unity admob  plugin

  1. if (Device.generation == DeviceGeneration.iPhoneX) {
  2.             bannerView = new BannerView (adUnitId, CurrentBannerSize, 0, (int)Screen.safeArea.yMax / 3 - BannerHeight / 3);
  3.         } else {
  4.             bannerView = new BannerView (adUnitId, CurrentBannerSize,AdPosition.Bottom);
  5.         }

David Appledore

unread,
Nov 17, 2017, 4:40:04 AM11/17/17
to Google Mobile Ads SDK Developers
I saw this in the source code, i think in latest version can just use AdPosition.Bottom and it moves above the safe area! no need for manual calculation. I still dont know why i needed to divide by 3 though?

if (IsOperatingSystemAtLeastVersion(11)) {
parentBounds = parentView.safeAreaLayoutGuide.layoutFrame;
}

Deepika Uragayala- MobileAds SDK team

unread,
Nov 17, 2017, 3:34:48 PM11/17/17
to Google Mobile Ads SDK Developers
Hi David,

Can you log the yMax and check what is being logged? And check the Banner Height and see if it's correlating when you anchor it to the bottom? I'm assuming that there might be missed calculation. You must not need to divide it by 3 to get this over the safe area.

Regards,
Deepika Uragayala
Mobile Ads SDK Team
Reply all
Reply to author
Forward
0 new messages