Why the interstitial Ads can not display correctly in landscape orientation?

242 views
Skip to first unread message

yi zheng

unread,
Sep 25, 2017, 2:02:08 AM9/25/17
to Google Mobile Ads SDK Developers
I add a interstitial to the view of my ViewControl,It can display correctly when the supported orientations of the project is set to portrait.
However, When set the supported orientations to landscape, it shows the content on the corner of screen.

 I know it may not the bug of the Admob SDK,there maybe some wrong settings in my root view controller,What can cause this issue?

IMG_9969.PNG
IMG_9970.PNG

yi zheng

unread,
Sep 25, 2017, 2:07:53 AM9/25/17
to Google Mobile Ads SDK Developers
SDK version: GoogleMobileAdsSdkiOS-7.23.0
device: iPhone 7 plus,iPhone 5s, iPad with version 10.*
code to display ad:

if (interstitial.isReady) {
             UIViewController *rootViewController = (ViewController *)((AppDelegate *)[[UIApplication sharedApplication] delegate]).window.rootViewController;
            [interstitial presentFromRootViewController:rootViewController];
        }

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Sep 25, 2017, 4:16:28 AM9/25/17
to Google Mobile Ads SDK Developers
Hi there,

I would like to point out that the orientation of an Interstitial Ad is determined at the time of the Ad Request. So if you request for an Interstitial Ad when the phone is in Portrait mode, then it will try to display the ad in Portrait and vice versa for Landscape.

However, this seems like an implementation issue. Can you provide us a sample project where we can replicate the behavior? Kindly provide us the appropriate steps to replicate as well. Additionally, can you check if you can replicate the same behavior on our sample apps?

Regards,
Joshua Lagonera
Mobile Ads SDK Team

yi zheng

unread,
Sep 26, 2017, 8:29:01 PM9/26/17
to Google Mobile Ads SDK Developers
Hi,
here is the demo project.
src.zip contains the objective c code that how I add interstitial, it is compiled and linked into the the lib godot_opt.iphone that is in the Godot_ios_xcode_admob,zip project.
It do not support running on simulator, please run on a device. I have already compiled and linked it, just run the iOS project can replicate the issue, no matter which orientations is the device hold.

the code and project:

I can not replicate this in sample apps.




Here are some linkers for your reference:
doc for how to compile modules on iOS:
and the engine code, I compiled in the 2.1 branch:



Joshua Lagonera (Mobile Ads SDK Team)

unread,
Sep 27, 2017, 12:00:54 AM9/27/17
to Google Mobile Ads SDK Developers
Hi there,

Thanks for providing me the requested information. However, I'm afraid that we do not support any third-party platforms and/or plugins in this forum (such as "Godot") and we will not be able to guarantee that everything will be working as intended. I would recommend you reach out to the support team of the platform/plugin you are using for further assistance on this.

Regards,
Joshua Lagonera
Mobile Ads SDK Team

yi zheng

unread,
Sep 27, 2017, 12:18:16 AM9/27/17
to Google Mobile Ads SDK Developers
Thanks for your reply.
I guess the issue is related to the engine itself.
Could you check if there is any problem in my implementation code for interstitial in admob.mm and admob.h?
And what may cause the issue from your experience? 
Is it caused  by the something wrong settings in the root view controller that the interstitial is presented in?

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Sep 27, 2017, 2:42:46 AM9/27/17
to Google Mobile Ads SDK Developers
Hi there,

I looked through your implementation and I didn't notice anything suspicious from our perspective, and the code implementation seems to be straightforward. Although I noticed that you seem to be using the Application's Root ViewController to present your Interstitial Ads and not the current ViewController. You can check out on where to appropriately display the Interstitial Ad from our official documentation.

As previously mentioned, it would be best for you to contact the support team of the platform you are using for further assistance as they are out of scope for our support.

Regards,
Joshua Lagonera
Mobile Ads SDK Team

yi zheng

unread,
Sep 27, 2017, 2:55:58 AM9/27/17
to Google Mobile Ads SDK Developers
Hi,
Thanks for your help.
It's a game engine, and it only has one root view controller.
I try to contact the engine developer, but they seems thought it''s a issue of the third party SDK.
What issue of the root view controller may cause the ad displayed like this?
Is it related to the supported orientation of the view controller?

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Sep 27, 2017, 4:12:22 AM9/27/17
to Google Mobile Ads SDK Developers
Hi there,

It can be related to the supported orientation of the View Controller. You can try forcing your application to be in Landscape only since, as previously mentioned, the orientation of the Interstitial Ad is determined at the time of the Ad Request.

Regards,
Joshua Lagonera
Mobile Ads SDK Team

yi zheng

unread,
Sep 27, 2017, 4:31:59 AM9/27/17
to Google Mobile Ads SDK Developers
Hi,
I have been testing it always with only  then landscapes is checked, It always display incorrectly.
But when I also check the portrait on, and make sure  the device keeps the same orientation between load and show interstitial, it will show correctly.
It's very odd.

yi zheng

unread,
Sep 27, 2017, 4:34:46 AM9/27/17
to Google Mobile Ads SDK Developers
And more information, the supportedInterfaceOrientations method of the view controller is absent,By default it support all.
Even if I add it and let it only support landscape, it's all the same.

yi zheng

unread,
Sep 27, 2017, 5:26:10 AM9/27/17
to Google Mobile Ads SDK Developers
And it can be displayed fine on iPad.

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Sep 27, 2017, 6:28:29 AM9/27/17
to Google Mobile Ads SDK Developers
Hi there,

As previously mentioned, we would not be able to provide support for any third-party platforms, plugins and the like and we cannot guarantee that they will work properly using them. It would be best for you to contact the platform you are using for further assistance on this.

Regards,
Joshua Lagonera
Mobile Ads SDK Team

Reply all
Reply to author
Forward
0 new messages