Wrong orientation for interstitial ads on Android & Unity

2,159 views
Skip to first unread message

Denis Baranov

unread,
Mar 1, 2015, 1:07:44 PM3/1/15
to google-adm...@googlegroups.com
Hi!
Since Feb 28 I have a strange bug. Interstitial ads on my Unity game on Android now always presented in portrait mode, even when the game is running on landscape. I didn't do anything new with ads code, it happened by itself. Seems to me, problem is on Admob side, but I'm not sure.

А week ago ads had correct landscape orientation, so I took old binaries and run it. But even on old binaries, today I see wrong portrait ads.

Build for iOS works correctly.

Code is very simple.

    interstitial = new InterstitialAd(adUnitId);

    AdRequest request = new AdRequest.Builder().Build();        
    interstitial.LoadAd(request);
    ...
    ...
    interstitial.Show();


Does anybody have any ideas how to fix it? Or at least tell me, that I'm not alone with that problem.

I use latest Unity (4.6.3f1), latest Google Mobile Ads Unity plugin, Google Play services rev. 22. AndroidManifest I took from plugin without changes.

Eric Leichtenschlag (Mobile Ads SDK Team)

unread,
Mar 1, 2015, 5:16:50 PM3/1/15
to google-adm...@googlegroups.com
Hi Denis,

In your display settings, your device must be locked into portrait even if the device is rotated to landscape. If your device is locked to portrait and an interstitial supports both orientations (which I believe all AdMob interstitials do), AdMob respects that Android setting and displays the interstitial in portrait.

If you turn that setting off, the interstitial will display in your apps current orientation.

Thanks,
Eric

Denis Baranov

unread,
Mar 2, 2015, 12:26:39 AM3/2/15
to google-adm...@googlegroups.com
Hi Eric,

You right. I had lost half of a day trying to fix this bug, before I ask you. After that, I looked into Android settings and located that auto rotation was disabled. But in the game rotation was working fine. Looks like screen rotation in the game is ruled by Unity project settings and ignores Android setting, but AdMob use Android setting and ignores Unity. That's why I was confused.

Thank you very much,
Denis

понедельник, 2 марта 2015 г., 2:16:50 UTC+4 пользователь Eric Leichtenschlag (Mobile Ads SDK Team) написал:

Eric Leichtenschlag (Mobile Ads SDK Team)

unread,
Mar 2, 2015, 11:43:23 AM3/2/15
to google-adm...@googlegroups.com
Unity must be telling Android that your activity only supports landscape. For Activities that only support landscape, Android will render in landscape even if the phone is locked to portrait.

Most AdMob interstitials support both orientations. Since the ads support portrait, Android will prefer portrait when that setting is enabled.

Thanks,
Eric
Reply all
Reply to author
Forward
0 new messages