Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8306777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:23:50+00:00 2026-06-08T18:23:50+00:00

I just implemented adWhirl to my app with iAds and adMob. Everything compiles correctly

  • 0

I just implemented adWhirl to my app with iAds and adMob. Everything compiles correctly and adMob works perfectly, but my iAd’s are not being sized correctly. the ad looks like its the right size, but it actually appears to be cut off. About 1/4 of the ad seems like it is missing. Since i have no bugs i don’t know exactly where to look to fix this.

here is a screenshot of what my ad bar looks like.

https://i.stack.imgur.com/dUexq.jpg

any help or just a nudge in the right direction would be appreciated!

here is the AdWhirlAdapteriAd.h

#import "AdWhirlAdNetworkAdapter.h"
#import <iAd/ADBannerView.h>

@interface AdWhirlAdapterIAd : AdWhirlAdNetworkAdapter <ADBannerViewDelegate> {
  NSString *kADBannerContentSizeIdentifierPortrait;
  NSString *kADBannerContentSizeIdentifierLandscape;
}

+ (AdWhirlAdNetworkType)networkType;

@end

here is AdWhirlAdapteriAd.m

#import "AdWhirlAdapterIAd.h"
#import "AdWhirlAdNetworkConfig.h"
#import "AdWhirlView.h"
#import "AdWhirlLog.h"
#import "AdWhirlAdNetworkAdapter+Helpers.h"
#import "AdWhirlAdNetworkRegistry.h"

@implementation AdWhirlAdapterIAd

+ (AdWhirlAdNetworkType)networkType {
  return AdWhirlAdNetworkTypeIAd;
}

+ (void)load {
  if(NSClassFromString(@"ADBannerView") != nil) {
    [[AdWhirlAdNetworkRegistry sharedRegistry] registerClass:self];
  }
}

- (void)getAd {
  ADBannerView *iAdView = [[ADBannerView alloc] initWithFrame:CGRectZero];
  kADBannerContentSizeIdentifierPortrait =
    &ADBannerContentSizeIdentifierPortrait != nil ?
      ADBannerContentSizeIdentifierPortrait :
      ADBannerContentSizeIdentifierPortrait;
  kADBannerContentSizeIdentifierLandscape =
    &ADBannerContentSizeIdentifierLandscape != nil ?
      ADBannerContentSizeIdentifierLandscape :
      ADBannerContentSizeIdentifierPortrait;
  iAdView.requiredContentSizeIdentifiers = [NSSet setWithObjects:
                                        kADBannerContentSizeIdentifierPortrait,
                                        kADBannerContentSizeIdentifierLandscape,
                                        nil];
  UIDeviceOrientation orientation;
  if ([self.adWhirlDelegate respondsToSelector:@selector(adWhirlCurrentOrientation)]) {
orientation = [self.adWhirlDelegate adWhirlCurrentOrientation];
  }
  else {
    orientation = [UIDevice currentDevice].orientation;
  }

  if (UIDeviceOrientationIsLandscape(orientation)) {
    iAdView.currentContentSizeIdentifier = kADBannerContentSizeIdentifierLandscape;
  }
  else {
    iAdView.currentContentSizeIdentifier = kADBannerContentSizeIdentifierPortrait;
  }
  [iAdView setDelegate:self];

  self.adNetworkView = iAdView;
  [iAdView release];
}

- (void)stopBeingDelegate {
  ADBannerView *iAdView = (ADBannerView *)self.adNetworkView;
  if (iAdView != nil) {
    iAdView.delegate = nil;
  }
}

- (void)rotateToOrientation:(UIInterfaceOrientation)orientation {
  ADBannerView *iAdView = (ADBannerView *)self.adNetworkView;
  if (iAdView == nil) return;
  if (UIInterfaceOrientationIsLandscape(orientation)) {
    iAdView.currentContentSizeIdentifier = kADBannerContentSizeIdentifierLandscape;
  }
  else {
    iAdView.currentContentSizeIdentifier = kADBannerContentSizeIdentifierPortrait;
  }
  // ADBanner positions itself in the center of the super view, which we do not
  // want, since we rely on publishers to resize the container view.
  // position back to 0,0
  CGRect newFrame = iAdView.frame;
  newFrame.origin.x = newFrame.origin.y = 0;
  iAdView.frame = newFrame;
}

- (BOOL)isBannerAnimationOK:(AWBannerAnimationType)animType {
  if (animType == AWBannerAnimationTypeFadeIn) {
    return NO;
  }
  return YES;
}

- (void)dealloc {
  [super dealloc];
}

#pragma mark IAdDelegate methods

- (void)bannerViewDidLoadAd:(ADBannerView *)banner {
  // ADBanner positions itself in the center of the super view, which we do not
  // want, since we rely on publishers to resize the container view.
  // position back to 0,0
  CGRect newFrame = banner.frame;
  newFrame.origin.x = newFrame.origin.y = 0;
  banner.frame = newFrame;

  [adWhirlView adapter:self didReceiveAdView:banner];
}

- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
  [adWhirlView adapter:self didFailAd:error];
}

- (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:              (BOOL)willLeave {
  [self helperNotifyDelegateOfFullScreenModal];
  return YES;
}

- (void)bannerViewActionDidFinish:(ADBannerView *)banner {
  [self helperNotifyDelegateOfFullScreenModalDismissal];
}

@end

Here is where the ads are being called in the app

MainMenuInterface.h

#import <Foundation/Foundation.h>
#import "cocos2d.h"
#import "GameManager.h"
#import "AdWhirlView.h"
#import "AdWhirlDelegateProtocol.h"
#import "Reading_FluencyAppDelegate.h"
#import "RootViewController.h"

enum GameStatePP {
    kGameStatePlaying,
    kGameStatePaused
};


@interface MainMenuInterface : CCLayer <AdWhirlDelegate>

{
    CCMenu *mainMenu;
    CCMenu *aboutPage;

    RootViewController *viewController;
    AdWhirlView *adWhirlView;
    enum GameStatePP _state;
}

@property(nonatomic,retain) AdWhirlView *adWhirlView;
@property(nonatomic) enum GameStatePP state;

-(void)displayStartButton;

@end

and here is the important stuff in MainMenuInterface.m

- (void)adWhirlWillPresentFullScreenModal {

    if (self.state == kGameStatePlaying) {

        //[[SimpleAudioEngine sharedEngine] pauseBackgroundMusic];

        [[CCDirector sharedDirector] pause];
  }
}

- (void)adWhirlDidDismissFullScreenModal {

    if (self.state == kGameStatePaused)
        return;

    else {
        self.state = kGameStatePlaying;
        //[[SimpleAudioEngine sharedEngine] resumeBackgroundMusic];
        [[CCDirector sharedDirector] resume];

    }
}

- (NSString *)adWhirlApplicationKey {
    return @"23myapplicationkey39203924";
}

- (UIViewController *)viewControllerForPresentingModalView {
    return viewController;
}

-(void)adjustAdSize {
    [UIView beginAnimations:@"AdResize" context:nil];
    [UIView setAnimationDuration:0.2];
    CGSize adSize = [adWhirlView actualAdSize];
    CGRect newFrame = adWhirlView.frame;
newFrame.size.height = adSize.height;

CGSize winSize = [CCDirector sharedDirector].winSize;
newFrame.size.width = winSize.width;
newFrame.origin.x = (self.adWhirlView.bounds.size.width - adSize.width)/2;

newFrame.origin.y = (winSize.height - adSize.height);
adWhirlView.frame = newFrame;
[UIView commitAnimations];
}

- (void)adWhirlDidReceiveAd:(AdWhirlView *)adWhirlVieww {
[adWhirlView rotateToOrientation:UIInterfaceOrientationLandscapeRight];
[self adjustAdSize];

}

-(void)onEnter {
    viewController = [(Reading_FluencyAppDelegate *)[[UIApplication sharedApplication]         delegate] viewController];
    self.adWhirlView = [AdWhirlView requestAdWhirlViewWithDelegate:self];
    self.adWhirlView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin;

    [adWhirlView updateAdWhirlConfig];
CGSize adSize = [adWhirlView actualAdSize];
CGSize winSize = [CCDirector sharedDirector].winSize;
self.adWhirlView.frame = CGRectMake((winSize.width/2)-(adSize.width/2),winSize.height-            adSize.height,winSize.width,adSize.height);
self.adWhirlView.clipsToBounds = YES;
[viewController.view addSubview:adWhirlView];
[viewController.view bringSubviewToFront:adWhirlView];
[super onEnter];
}

-(void)onExit {
if (adWhirlView) {
    [adWhirlView removeFromSuperview];
    [adWhirlView replaceBannerViewWith:nil];
    [adWhirlView ignoreNewAdRequests];
    [adWhirlView setDelegate:nil];
    self.adWhirlView = nil;
}
[super onExit];
}

-(void)dealloc
{
self.adWhirlView.delegate = nil;
self.adWhirlView = nil;
[super dealloc];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:23:51+00:00Added an answer on June 8, 2026 at 6:23 pm

    for those that need to know in the future, my problem turned out to be that it was calling ads for landscape instead of portrait, than when it called adjustAdSize() it wasnt getting correct sizing.

    i changed

    - (void)adWhirlDidReceiveAd:(AdWhirlView *)adWhirlVieww {
        [adWhirlView rotateToOrientation:UIInterfaceOrientationLandscapeRight];
        [self adjustAdSize];
    {
    

    to

    - (void)adWhirlDidReceiveAd:(AdWhirlView *)adWhirlVieww {
        [adWhirlView rotateToOrientation:UIInterfaceOrientationPortrait];
        [self adjustAdSize];
    {
    

    and it fixed all my problems!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just implemented QuickSort algorithm from book and got weird output. It works but
I've just implemented iAds in an app with several distinct UIViewControllers. I have the
I've just implemented Elmah for logging in my MVC3 app, and of course all
I have just implemented WMD for my editor in an ASP.NET app. The problem
I am developing a Silverlight app using VS2008 Express. I have just implemented a
I just implemented the ActiveAdmin gem with my Rails 3.1 app, and it caused
I just implemented a star rating system on my site, but I'm having a
I just implemented the onClickListener. The App should switch between two layouts. On each
I've just implemented SQLCipher in my app to encrypt one fairly simple database. I
I just implemented the ODCIAggregate Interface to create a custom aggregation function. It works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.