FBAdView
A more recent version of this class is available. Check out the latest version.

A customized UIView to represent a Facebook ad (a.k.a. banner ad).

Conforms to:UIWebViewDelegate
Inherits from:UIView
Declared in:FBAdView.h
Properties
delegate

The delegate

@property (nonatomic, weak) id<FBAdViewDelegate> delegate;
Declared In: FBAdView.h
placementID

Typed access to the id of the ad placement.

@property (nonatomic, copy, readonly) NSString *placementID;
Declared In: FBAdView.h
rootViewController

Typed access to the app's root view controller.

@property (nonatomic, weak, readonly) UIViewController *rootViewController;
Declared In: FBAdView.h
Instance Methods
initWithPlacementID:adSize:rootViewController:

This is a method to initialize an FBAdView matching the given placement id.

ParameterDescription
placementID

The id of the ad placement. You can create your placement id from Facebook developers page.

adSize

The size of the ad; for example, kFBAdSize320x50.

rootViewController

The view controller that will be used to present the ad and the app store view.

- (instancetype)
initWithPlacementID: (NSString *)placementID
adSize: (FBAdSize)adSize
rootViewController: (UIViewController *)viewController;
Declared In: FBAdView.h
loadAd

Begins loading the FBAdView content.

- (void) loadAd;
Discussion:

You can implement adViewDidLoad: and adView:didFailWithError: methods of FBAdViewDelegate if you would like to be notified as loading succeeds or fails.

Declared In: FBAdView.h
Constants
kFBAdSize320x50
extern FBAdSize const kFBAdSize320x50;
Declared In: FBAdView.h
kFBAdSizeInterstital
extern FBAdSize const kFBAdSizeInterstital;
Declared In: FBAdView.h
Typedefs
FBAdSize

Represents the ad size.

typedef struct FBAdSize {
CGSize size;
} FBAdSize;
Declared In: FBAdView.h