A customized UIView to represent a Facebook ad (a.k.a. banner ad).
Conforms to: | UIWebViewDelegate |
Inherits from: | UIView |
Declared in: | FBAdView.h |
delegate
The delegate
@property (nonatomic,
weak) id<FBAdViewDelegate> delegate;
FBAdView.h
placementID
Typed access to the id of the ad placement.
@property (nonatomic,
copy,
readonly) NSString *placementID;
FBAdView.h
rootViewController
Typed access to the app's root view controller.
@property (nonatomic,
weak,
readonly) UIViewController *rootViewController;
FBAdView.h
initWithPlacementID:adSize:rootViewController:
This is a method to initialize an FBAdView matching the given placement id.
Parameter | Description |
---|---|
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, kFBAdSizeHeight50Banner or kFBAdSizeHeight90Banner. |
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; |
FBAdView.h
loadAd
Begins loading the FBAdView content.
- (void)
loadAd;
You can implement adViewDidLoad:
and adView:didFailWithError:
methods
of FBAdViewDelegate
if you would like to be notified as loading succeeds or fails.
FBAdView.h
kFBAdSize320x50
extern FBAdSize const kFBAdSize320x50;
FBAdView.h
kFBAdSizeHeight50Banner
extern FBAdSize const kFBAdSizeHeight50Banner;
FBAdView.h
kFBAdSizeHeight90Banner
extern FBAdSize const kFBAdSizeHeight90Banner;
FBAdView.h
kFBAdSizeInterstital
extern FBAdSize const kFBAdSizeInterstital;
FBAdView.h
FBAdSize
Represents the ad size.
typedef struct FBAdSize { CGSize size; } FBAdSize;
FBAdView.h