Implementing iAd in iPhone/iPad/iPod Touch Application
Implementing iAds in your iPhone/iPad Application is really very simple.
2. In ViewController.h #import <iAd/ADBannerView.h>
4. Now take a ADBannerView in ViewController.xib.
5. Set IBOutlet to ADBannerView (as iADBannerView here).
7. In ViewController.m set iADBannerView as Hidden in viewDidLoad method. Which will hide the ADBannerView while loading controller screen.
8. Now add delegate methods of ADBannerView mentioned below:
- (void)bannerViewDidLoadAd:(ADBannerView *)banner;
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error;
9. In bannerViewDidLoadAd method unhide the ADBannerView. As method name specifies this method is executed when ADBannerView loads.
11. Now when top tap on ADBannerView it will show you a "Test Advertisement" screen as shown in below snapshot. This means you are all done, and ready to go.
You can download sample code from here: iAdDemo
Comments
Post a Comment