Admob interstitial screen orientation

895 views
Skip to first unread message

syedh...@satistrum.com

unread,
Jan 16, 2015, 8:15:03 AM1/16/15
to google-adm...@googlegroups.com

Dear Helper,

I am using iPhone 6 with IOS 8.1 and situation is my application has different type of games and these games are using different mode of screen orientation some games are using landscape and other are using portrait, when user is playing in landscape mode and Admob interstitial appears in portrait mode. 

so my question is, how can i restrict SDK to load and show Admob interstitial in landscape when user is playing game in landscape mode or show in potrait if user is playing in portrait mode? 

second question is how and when SDK is detecting the screen orientation of device?

thanks in Advance 

best regards

Hassan

syedh...@satistrum.com

unread,
Jan 16, 2015, 8:45:42 AM1/16/15
to google-adm...@googlegroups.com
i am using 6.13-2
adunitid is = ca-app-pub-4645525112946949/xxxxxxxxxxxxx 

Andrew Brogdon (Mobile Ads SDK Team)

unread,
Jan 16, 2015, 2:16:00 PM1/16/15
to google-adm...@googlegroups.com
> so my question is, how can i restrict SDK to load and show Admob interstitial in landscape 
> when user is playing game in landscape mode or show in potrait if user is playing in portrait mode? 

You should not need to do this.  The SDK will detect for itself in which orientation the device is held and handle things automatically.

> second question is how and when SDK is detecting the screen orientation of device?

This happens when you first make the request to load an interstitial.  The request must include information about the state of the device in order to return the best possible ad.  If you're loading interstitials well in advance of display, and there's a chance that the user may rotate the device in between, consider shortening the delay between requesting the ad and showing it.

-Andrew

Syed Muhammad Hassan

unread,
Jan 17, 2015, 12:21:40 AM1/17/15
to google-adm...@googlegroups.com
thanks Mr Andrew,

 here is my piece of code  for loading the Admob

- (GADInterstitial *)createAndLoadInterstitial {

    if([self orientation] == 0) {

        NSLog(@"potrait screen");

        //do portrait work

    } else {

        //do landscape work

        NSLog(@"Landscape");

    }

    GADInterstitial *admobInterstitial = [[GADInterstitial alloc] init];

    admobInterstitial.adUnitID = @"ca-app-pub-4645525112946949/2328818911";

    admobInterstitial.delegate = self;

    [admobInterstitial loadRequest:[GADRequest request]];

    //request.testDevices = @[ GAD_SIMULATOR_ID ];

    NSLog(@"load gad");

    return admobInterstitial;

}


before loading i check it its a landscape mode but even then Ads display in landscape mode, so what the problem then?

one more thing i think you know, in iOS 8 detecting the screen orientation is not before, i hope you update latest ver of sdks according to IOS 8

Best regards

Hassan



--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/Fz2QXQF5v70/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Brogdon (Mobile Ads SDK Team)

unread,
Jan 20, 2015, 10:05:27 PM1/20/15
to google-adm...@googlegroups.com
> before loading i check it its a landscape mode but even then Ads display in landscape mode

I'm a little confused.  I thought the issue was that when the device was in landscape mode, interstitials were in portrait?

Your code looks fine, though I'm curious why you're not using UIInterfaceOrientationIsPortrait to check the device orientation.  As long as the device orientation doesn't change in between the loading and the displaying of interstitials, you should be fine.

If you haven't already, try using test ads to make sure it's not a problem with a creative.

-Andrew
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

Syed Muhammad Hassan

unread,
Feb 2, 2015, 6:07:37 AM2/2/15
to google-adm...@googlegroups.com
thanks for helping me out, now problem is solved, 

thanks Andrew

Best regards

Hassan 

To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages