osta
osta

Reputation: 29

A simply question about iAd

I want to ask something about iAd's.

My main view controller include ADBannerViewDelegate and shows iAd banner correctly.

But I need to show iAd in all views

so should I transfer the same banner to all my view?
Or it is better to create a new iAd banner in IB for each view? like here:

TempsReel *tempsReel = [[TempsReel alloc]initWithNibName:@"TempsReel" withBanner:adView];

        [self.navigationController pushViewController:tempsReel animated:YES];
        [tempsReel release];

Thanks for your help.

Upvotes: 1

Views: 1355

Answers (2)

Kenny Wyland
Kenny Wyland

Reputation: 21870

A UITabBarController or UINavigationController is by default going to take up the entire screen. What I did in my last app was just leave an iAd sized gap in my xibs for the view controllers inside the tab bar controller or nav controller.

In my application delegate, I create the iAd banner view and add it directly to the tab bar or nav controller's view.

iAdView.frame = CGRectMake(...);
[tabBarController.view addSubview:iAdView];

Then it'll be there all the time, regardless of what tab you are on or what level in the nav stack you are.

An additional note... I suggest checking out https://www.adwhirl.com/ They provide an easy to use system that will allow you to include ads from many different sources including iAd. Apple only fills like 10% of ad requests, so you are missing out on revenue for the remaining 90%.

Upvotes: 4

W Dyson
W Dyson

Reputation: 4634

You're not supposed to be showing more than one iAd banner at a time, or an iAd banner on screen with any other ad from another agency for that matter.

For apps with UITabBarControllers or UINavigationController as their main setup, I believe the iAd guidelines give advice on what you should do to keep a single ad banner onscreen at all times.

I would look into adding iAds either UIWindow or a UIView, either at the bottom or top, and then putting the tab bar or nav controller in the remainder of the screen.

I haven't done this myself but this is where I would start. Keep in mind that you won't have a banner displayed all the time so whatever else you have onscreen needs to resize appropriately.

If you have a main view that's viewed the majority of the time, I would just put a banner view there and forget about the rest if this seems like too much work.

Hope this helps.

Upvotes: 1

Related Questions