How to add iAd to the application

I want to add iAd to my application. And I did a lot of research and saw a video that showed how to add iAd to your project. But all the videos and tutorials display the code for adding iAd to the project, none of them said anything about whether to do something in iTunes or not.

I saw this link in apple doc . which is nice to add iAd. and this link will display the iTunes Connect Developer Guide tab, which will display some of the settings we need to make in iTunes connect in order to add iAd to the application.

So, as I understand it, we must first complete this setup in iTunes connect for iAd, and then implement the code to add iAd to the project.

But I got confused on this line in apple doc After you have enabled at least one app for iAd ads, you see the iAd Network module on your iTunes Connect homepage. What does it mean to enable the app for iAd?

+4
source share
2 answers

Go to itunes connect → manage your applications and select the application you need, then click “Configure iAd Network” just like that.

But I got confused on this line in apple doc. After you’ve enabled at least one iAd app, you’ll see the iAd Network module on the iTunes Connect homepage. What does it mean to enable the app for iAd?

This means that when you activate iAd (as I said), a new module appears, called iAd Network, and there you can see statistics (impresions, income, etc.)

+1
source

itunesconnect → manage your applications

and this code is the iAd network default screen display

 #import <UIKit/UIKit.h> #import <iAd/iAd.h> @interface iAdExViewController : UIViewController <ADBannerViewDelegate> { ADBannerView *adView; BOOL bannerIsVisible; } @property (nonatomic,assign) BOOL bannerIsVisible; @end 

Then change the viewDidLoad method to iAdExViewController.m

 - (void)viewDidLoad { adView = [[ADBannerView alloc] initWithFrame:CGRectZero]; adView.frame = CGRectOffset(adView.frame, 0, -50); adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifier320x50]; adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50; [self.view addSubview:adView]; adView.delegate=self; self.bannerIsVisible=NO; [super viewDidLoad]; } - (void)bannerViewDidLoadAd:(ADBannerView *)banner { if (!self.bannerIsVisible) { [UIView beginAnimations:@"animateAdBannerOn" context:NULL]; // banner is invisible now and moved out of the screen on 50 px banner.frame = CGRectOffset(banner.frame, 0, 50); [UIView commitAnimations]; self.bannerIsVisible = YES; } } - (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error { if (self.bannerIsVisible) { [UIView beginAnimations:@"animateAdBannerOff" context:NULL]; // banner is visible and we move it out of the screen, due to connection issue banner.frame = CGRectOffset(banner.frame, 0, -50); [UIView commitAnimations]; self.bannerIsVisible = NO; } } - (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave { NSLog(@"Banner view is beginning an ad action"); BOOL shouldExecuteAction = YES; if (!willLeave && shouldExecuteAction) { // stop all interactive processes in the app // [video pause]; // [audio pause]; } return shouldExecuteAction; } - (void)bannerViewActionDidFinish:(ADBannerView *)banner { // resume everything you've stopped // [video resume]; // [audio resume]; } 
+5
source

All Articles