sexta-feira, 29 de abril de 2016
teste
// 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:@"267007103643514_267009753643249"
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;
}
Assinar:
Postar comentários (Atom)
Nenhum comentário:
Postar um comentário