// Import the SDK header file and declare that you are implementing // the FBAdViewDelegate protocol: #import @interface MyViewController : UIViewController // Other code might go here... @end // In your View Controller, create a new instance of the FBAdView // and add it to your view hierarchy: - (void)viewDidLoad { [super viewDidLoad]; FBAdView *adView = [[FBAdView alloc] initWithPlacementID:@"264293564021066_264294194021003" adSize:kFBAdSize320x50 rootViewController:self]; adView.delegate = self; [adView loadAd]; // Reposition the adView // ... [self.view addSubview:adView]; } // Now that you have the basic code running, it is recommended that you use // the FBAdView delegate to get notified when the ad fails to load so you // could hide the banner unit. In the same way, you can add it back when it // was loaded: - (void)adView:(FBAdView *)adView didFailWithError:(NSError *)error; { NSLog(@"Ad failed to load"); // Add code to hide the ad unit... // E.g. adView.hidden = YES; } - (void)adViewDidLoad:(FBAdView *)adView; { NSLog(@"Ad was loaded and ready to be displayed"); // Add code to show the ad unit... // E.g. adView.hidden = NO; }

Header Ads

EDWARD JENNER

23:10
EDWARD JENNER Smallpox might have been a standout amongst those practically dangerous and fared illnesses. Person over three from cla...
EDWARD JENNER EDWARD JENNER Reviewed by vijaykumar on 23:10 Rating: 5

LOUIS PASTEUR

22:53
LOUIS PASTEUR Louis pasteur might have been those creater for 1st immunization for Rabies, a dangerous ailment initiated Eventually ...
LOUIS PASTEUR LOUIS PASTEUR Reviewed by vijaykumar on 22:53 Rating: 5

Ad Home

Powered by Blogger.