Using AdMob for iPad and show Ad at bottom

304 views
Skip to first unread message

mikezang

unread,
Jan 14, 2012, 8:13:05 AM1/14/12
to AdWhirl Users
I modified source to show Ad at the bottom of screen, then use AdMob
to suite iPad screen as below:

// AdWhirlAdapterGoogleAdMobAds.m
// Show AdMob in iPad
- (void)getAd {
....

CGRect frame;
CGSize bannerSize;

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
bannerSize = GAD_SIZE_728x90;
}
else {
bannerSize = GAD_SIZE_320x50;
}

frame.size = CGSizeMake(bannerSize.width, bannerSize.height);

GADBannerView *view = [[GADBannerView alloc] initWithFrame:frame];

// Set the frame for this view to match the bounds of the parent
adWhirlView.
//GADBannerView *view = [[GADBannerView alloc]
initWithFrame:adWhirlView.bounds];

....
}

// Show Ads at bottom of screen
// YourViewController.m
- (void)adWhirlDidReceiveAd:(AdWhirlView *)adWhirlView {
[UIView beginAnimations:@"AdWhirlDelegate.adWhirlDidReceiveAd:"
context:nil];

[UIView setAnimationDuration:0.7];

CGSize adSize = [adWhirlView actualAdSize];
CGRect newFrame = adWhirlView.frame;

newFrame.size = adSize;
newFrame.origin.x = (self.view.bounds.size.width - adSize.width) /
2;
newFrame.origin.y = self.view.bounds.size.height - adSize.height;

adWhirlView.frame = newFrame;

[UIView commitAnimations];
}

88

unread,
May 31, 2012, 3:52:48 AM5/31/12
to adwhir...@googlegroups.com
Hi, thanks for this, just be careful not to display at the bottom of the maps, otherwise it would not make it to appstore because of hidden G logo.
Reply all
Reply to author
Forward
0 new messages