0

From my understanding, iAds are made with html5, js, and css3 - therefore i'm assuming that the code that drives it is downloaded onto the device to display. How would i go about downloading it to my laptop to see how it works, if my ipad is on the same wireless network as my laptop?

nuway
  • 2,324
  • 4
  • 27
  • 48

2 Answers2

1

Are you trying to do iAD testing before deploying your app on the app store? Your iAds tie in with your Apple Developer account and therefore would only require your Code Signing before uploading the app to the store. Answering your question, if you would like to test if iAds works with a generic Ad, heres the code on how to go about doin that:

In your .h File of the view controller

#import "iAd/ADBannerView.h" //Add the iAd.framework to your Build

    @interface YourViewController: UIViewController <ADBannerViewDelegate> { 
//Dont forget to add the delegate

BOOL bannerDisplayed;

}

Then in your .m file

 - (void) viewDidLoad {
   ADBannerView *adBanner = [[ADBannerView alloc] initWithFrame:CGRectMake(0, -50, 320, 50)]; 
    adBanner.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
    adBanner.delegate = self;
    [self.view addSubview:adBanner];
}

- (void) bannerViewDidLoadAd:(ADBannerView *)banner {

    if(!bannerDisplayed) {
        NSLog(@"iAd Banner Appear");
        [UIView beginAnimations:@"bannerAppear" context:NULL];
        banner.frame = CGRectOffset(banner.frame, 0, 411);
        [UIView commitAnimations];
        bannerDisplayed = YES;
    } else {
        NSLog(@"iAd Banner Appear Error. Not a FailAdWithError.");
    }
}

- (void) bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
    if(bannerDisplayed) {
        NSLog(@"Banner Error. Remove Ad from Screen");
        [UIView beginAnimations:@"bannerDisappear" context:NULL];

        banner.frame = CGRectOffset(banner.frame, 0, -411);
        [UIView commitAnimations];

        bannerDisplayed = NO;
    }
}

Apple requires that the iAd be able to remove/hide itself incase an error occurs when your iAd instance does not retrieve the Ad. Therefore it might take a second or two to show up then remove itself so as to mimic a success or failure.

vnchopra
  • 149
  • 10
  • no, i want to download hmml, js and css3 code that the iAd is made of – nuway Aug 03 '12 at 23:01
  • are you attempting to reverse engineer the iAd object? lol I am not sure if Apple has this open to the public. Maybe you need to reword your question? – vnchopra Aug 04 '12 at 00:28
0

I'm not sure if or how you can download an iAd, but you should take a look at iAd Producer https://developer.apple.com/iad/iadproducer/, which gives you enough examples to see how it works.

Sascha
  • 5,903
  • 3
  • 24
  • 20