forked from chrisjp/CJPAdController
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CJPAdController.h
65 lines (49 loc) · 2.31 KB
/
CJPAdController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// CJPAdController.h
// CJPAdController
//
// Created by Chris Phillips on 19/11/2011.
// Copyright (c) 2011 Chris Phillips. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <iAd/iAd.h>
#import "GADBannerView.h"
// Display iAds?
static BOOL const kUseiAd = YES;
// Display AdMob ads?
static BOOL const kUseAdMob = YES;
// Set which ads should be initially displayed and preferred ("iAd" or "AdMob")
static NSString * const kDefaultAds = @"iAd";
// Your AdMob publisher ID
static NSString * const kAdMobID = @"YOUR_PUBLISHER_ID";
// Use AdMob's "Smart" size banners (will fill full width of device)
// If set to NO, 320x50 ads will be used for iPhone/iPod and 728x90 for iPad
static BOOL const kUseAdMobSmartSize = YES;
// Where to position the ad on screen ("top" or "bottom")
static NSString * const kAdPosition = @"bottom";
// Show ad above the TabBar when ad position is set to bottom? (only relevant if you use a UITabBarController)
static BOOL const kAboveTabBar = YES;
// Seconds to wait before displaying ad after the view loads (0.0 = instant)
static float const kWaitTime = 2.0;
// Name of UserDefaults key for if ads have been purchased (you can ignore this if you don't have an IAP to remove ads)
static NSString * const kAdsPurchasedKey = @"adRemovalPurchased";
// Are you testing? Setting to YES will NSLog various events
static BOOL const kAdTesting = NO;
@interface CJPAdController : UIViewController <ADBannerViewDelegate, GADBannerViewDelegate>
@property (nonatomic, retain) ADBannerView *iAdView;
@property (nonatomic, retain) GADBannerView *adMobView;
@property (nonatomic, retain) UIViewController *contentController;
@property (nonatomic, retain) UIView *containerView;
@property (nonatomic, assign) BOOL showingiAd;
@property (nonatomic, assign) BOOL showingAdMob;
@property (nonatomic, assign) BOOL adsRemoved;
@property (nonatomic, assign) BOOL isTabBar;
@property (nonatomic, assign) BOOL iOS4;
+ (CJPAdController *)sharedManager;
- (id)initWithContentViewController:(UIViewController *)contentController;
- (void)createBanner:(NSString *)adType;
- (void)removeBanner:(NSString *)adType permanently:(BOOL)permanent;
- (void)restoreBanner:(NSString *)adType;
- (void)removeAllAdsForever;
- (void)layoutAds;
@end