From 005155b4caadb5d4e6aa801fa8f806e9925d820a Mon Sep 17 00:00:00 2001 From: Paul Cezanne Date: Thu, 29 Aug 2013 17:02:10 -0400 Subject: [PATCH 1/4] copy of the adcontrollerdemo project --- .../project.pbxproj | 409 ++++++++++++++++++ .../BannerViewAdDemo-Info.plist | 47 ++ .../BannerViewAdDemo-Prefix.pch | 18 + .../BannerViewAdDemo/LARSAppDelegate.h | 19 + .../BannerViewAdDemo/LARSAppDelegate.m | 98 +++++ .../LARSExampleViewController.h | 19 + .../LARSExampleViewController.m | 143 ++++++ .../en.lproj/InfoPlist.strings | 2 + .../BannerViewAdDemo/BannerViewAdDemo/main.m | 18 + Example/BannerViewAdDemo/Default-568h@2x.png | Bin 0 -> 18594 bytes 10 files changed, 773 insertions(+) create mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo.xcodeproj/project.pbxproj create mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewAdDemo-Info.plist create mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewAdDemo-Prefix.pch create mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo/LARSAppDelegate.h create mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo/LARSAppDelegate.m create mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.h create mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.m create mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo/en.lproj/InfoPlist.strings create mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo/main.m create mode 100644 Example/BannerViewAdDemo/Default-568h@2x.png diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo.xcodeproj/project.pbxproj b/Example/BannerViewAdDemo/BannerViewAdDemo.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e2ee8b9 --- /dev/null +++ b/Example/BannerViewAdDemo/BannerViewAdDemo.xcodeproj/project.pbxproj @@ -0,0 +1,409 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 4641EBB5167EA96B00A4E590 /* LARSAdController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4641EBAD167EA96B00A4E590 /* LARSAdController.m */; }; + 4641EBB7167EA96B00A4E590 /* TOLAdAdapteriAds.m in Sources */ = {isa = PBXBuildFile; fileRef = 4641EBB2167EA96B00A4E590 /* TOLAdAdapteriAds.m */; }; + 4641EBB8167EA96B00A4E590 /* TOLAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4641EBB4167EA96B00A4E590 /* TOLAdViewController.m */; }; + 4642C0A7167CFB040039EE16 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4642C0A6167CFB040039EE16 /* Default-568h@2x.png */; }; + 4652137116ACF9D5003635AB /* libGoogleAdMobAds.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4652133316ACF9D5003635AB /* libGoogleAdMobAds.a */; }; + 465B42971623820900CBC997 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 465B42961623820900CBC997 /* AdSupport.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + 4691CC6F165202A700559F58 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4691CC6E165202A700559F58 /* StoreKit.framework */; }; + 46B9178F14425C5F007EF823 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46B9178E14425C5F007EF823 /* UIKit.framework */; }; + 46B9179114425C5F007EF823 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46B9179014425C5F007EF823 /* Foundation.framework */; }; + 46B9179314425C5F007EF823 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46B9179214425C5F007EF823 /* CoreGraphics.framework */; }; + 46C1EAF6154C702A00EBFEF1 /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46C1EAF5154C702A00EBFEF1 /* iAd.framework */; }; + 46C1EAF8154C703000EBFEF1 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46C1EAF7154C703000EBFEF1 /* SystemConfiguration.framework */; }; + 46C1EAFA154C705E00EBFEF1 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46C1EAF9154C705E00EBFEF1 /* AudioToolbox.framework */; }; + 46C1EAFC154C706300EBFEF1 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46C1EAFB154C706300EBFEF1 /* MessageUI.framework */; }; + 46F8742016915DDF001A2DF8 /* TOLAdAdapterGoogleAds.m in Sources */ = {isa = PBXBuildFile; fileRef = 46F8741F16915DDF001A2DF8 /* TOLAdAdapterGoogleAds.m */; }; + AAAFED1E17CFEC5800D7FCCC /* LARSAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AAAFED1B17CFEC5800D7FCCC /* LARSAppDelegate.m */; }; + AAAFED1F17CFEC5800D7FCCC /* LARSExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AAAFED1D17CFEC5800D7FCCC /* LARSExampleViewController.m */; }; + AAAFED2317CFEC7E00D7FCCC /* BannerViewAdDemo-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = AAAFED2017CFEC7E00D7FCCC /* BannerViewAdDemo-Info.plist */; }; + AAAFED2417CFEC7E00D7FCCC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AAAFED2217CFEC7E00D7FCCC /* main.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 4641EBAC167EA96B00A4E590 /* LARSAdController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LARSAdController.h; sourceTree = ""; }; + 4641EBAD167EA96B00A4E590 /* LARSAdController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LARSAdController.m; sourceTree = ""; }; + 4641EBAE167EA96B00A4E590 /* TOLAdAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOLAdAdapter.h; sourceTree = ""; }; + 4641EBAF167EA96B00A4E590 /* TOLAdAdapterGoogleAds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOLAdAdapterGoogleAds.h; sourceTree = ""; }; + 4641EBB1167EA96B00A4E590 /* TOLAdAdapteriAds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOLAdAdapteriAds.h; sourceTree = ""; }; + 4641EBB2167EA96B00A4E590 /* TOLAdAdapteriAds.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOLAdAdapteriAds.m; sourceTree = ""; }; + 4641EBB3167EA96B00A4E590 /* TOLAdViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TOLAdViewController.h; sourceTree = ""; }; + 4641EBB4167EA96B00A4E590 /* TOLAdViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOLAdViewController.m; sourceTree = ""; }; + 4642C0A6167CFB040039EE16 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + 4652132916ACF9D5003635AB /* GADAdMobExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GADAdMobExtras.h; path = ../AdMob/GADAdMobExtras.h; sourceTree = SOURCE_ROOT; }; + 4652132A16ACF9D5003635AB /* GADAdNetworkExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GADAdNetworkExtras.h; path = ../AdMob/GADAdNetworkExtras.h; sourceTree = SOURCE_ROOT; }; + 4652132B16ACF9D5003635AB /* GADAdSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GADAdSize.h; path = ../AdMob/GADAdSize.h; sourceTree = SOURCE_ROOT; }; + 4652132C16ACF9D5003635AB /* GADBannerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GADBannerView.h; path = ../AdMob/GADBannerView.h; sourceTree = SOURCE_ROOT; }; + 4652132D16ACF9D5003635AB /* GADBannerViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GADBannerViewDelegate.h; path = ../AdMob/GADBannerViewDelegate.h; sourceTree = SOURCE_ROOT; }; + 4652132E16ACF9D5003635AB /* GADInterstitial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GADInterstitial.h; path = ../AdMob/GADInterstitial.h; sourceTree = SOURCE_ROOT; }; + 4652132F16ACF9D5003635AB /* GADInterstitialDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GADInterstitialDelegate.h; path = ../AdMob/GADInterstitialDelegate.h; sourceTree = SOURCE_ROOT; }; + 4652133016ACF9D5003635AB /* GADRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GADRequest.h; path = ../AdMob/GADRequest.h; sourceTree = SOURCE_ROOT; }; + 4652133116ACF9D5003635AB /* GADRequestError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GADRequestError.h; path = ../AdMob/GADRequestError.h; sourceTree = SOURCE_ROOT; }; + 4652133316ACF9D5003635AB /* libGoogleAdMobAds.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libGoogleAdMobAds.a; path = ../AdMob/libGoogleAdMobAds.a; sourceTree = SOURCE_ROOT; }; + 465B42961623820900CBC997 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; }; + 4691CC6E165202A700559F58 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; }; + 46B9178A14425C5F007EF823 /* BannerViewAdDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BannerViewAdDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 46B9178E14425C5F007EF823 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 46B9179014425C5F007EF823 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 46B9179214425C5F007EF823 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 46C1EAF5154C702A00EBFEF1 /* iAd.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iAd.framework; path = System/Library/Frameworks/iAd.framework; sourceTree = SDKROOT; }; + 46C1EAF7154C703000EBFEF1 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; + 46C1EAF9154C705E00EBFEF1 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + 46C1EAFB154C706300EBFEF1 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; + 46F8741F16915DDF001A2DF8 /* TOLAdAdapterGoogleAds.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOLAdAdapterGoogleAds.m; sourceTree = ""; }; + AAAFED1A17CFEC5800D7FCCC /* LARSAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LARSAppDelegate.h; path = BannerViewAdDemo/LARSAppDelegate.h; sourceTree = SOURCE_ROOT; }; + AAAFED1B17CFEC5800D7FCCC /* LARSAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LARSAppDelegate.m; path = BannerViewAdDemo/LARSAppDelegate.m; sourceTree = SOURCE_ROOT; }; + AAAFED1C17CFEC5800D7FCCC /* LARSExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LARSExampleViewController.h; path = BannerViewAdDemo/LARSExampleViewController.h; sourceTree = SOURCE_ROOT; }; + AAAFED1D17CFEC5800D7FCCC /* LARSExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LARSExampleViewController.m; path = BannerViewAdDemo/LARSExampleViewController.m; sourceTree = SOURCE_ROOT; }; + AAAFED2017CFEC7E00D7FCCC /* BannerViewAdDemo-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "BannerViewAdDemo-Info.plist"; path = "BannerViewAdDemo/BannerViewAdDemo-Info.plist"; sourceTree = SOURCE_ROOT; }; + AAAFED2117CFEC7E00D7FCCC /* BannerViewAdDemo-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "BannerViewAdDemo-Prefix.pch"; path = "BannerViewAdDemo/BannerViewAdDemo-Prefix.pch"; sourceTree = SOURCE_ROOT; }; + AAAFED2217CFEC7E00D7FCCC /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = BannerViewAdDemo/main.m; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 46B9178714425C5F007EF823 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4691CC6F165202A700559F58 /* StoreKit.framework in Frameworks */, + 465B42971623820900CBC997 /* AdSupport.framework in Frameworks */, + 46C1EAFC154C706300EBFEF1 /* MessageUI.framework in Frameworks */, + 46C1EAFA154C705E00EBFEF1 /* AudioToolbox.framework in Frameworks */, + 46C1EAF8154C703000EBFEF1 /* SystemConfiguration.framework in Frameworks */, + 46C1EAF6154C702A00EBFEF1 /* iAd.framework in Frameworks */, + 46B9178F14425C5F007EF823 /* UIKit.framework in Frameworks */, + 46B9179114425C5F007EF823 /* Foundation.framework in Frameworks */, + 46B9179314425C5F007EF823 /* CoreGraphics.framework in Frameworks */, + 4652137116ACF9D5003635AB /* libGoogleAdMobAds.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 4641EBAB167EA96B00A4E590 /* LARSAdController */ = { + isa = PBXGroup; + children = ( + 4641EBAC167EA96B00A4E590 /* LARSAdController.h */, + 4641EBAD167EA96B00A4E590 /* LARSAdController.m */, + 4641EBAE167EA96B00A4E590 /* TOLAdAdapter.h */, + 4641EBB9167EAA0E00A4E590 /* Ad Network Adapters */, + 4641EBB3167EA96B00A4E590 /* TOLAdViewController.h */, + 4641EBB4167EA96B00A4E590 /* TOLAdViewController.m */, + ); + name = LARSAdController; + path = ../../Source; + sourceTree = ""; + }; + 4641EBB9167EAA0E00A4E590 /* Ad Network Adapters */ = { + isa = PBXGroup; + children = ( + 4641EBAF167EA96B00A4E590 /* TOLAdAdapterGoogleAds.h */, + 46F8741F16915DDF001A2DF8 /* TOLAdAdapterGoogleAds.m */, + 4641EBB1167EA96B00A4E590 /* TOLAdAdapteriAds.h */, + 4641EBB2167EA96B00A4E590 /* TOLAdAdapteriAds.m */, + ); + name = "Ad Network Adapters"; + sourceTree = ""; + }; + 465212CF16ACF9D5003635AB /* AdMob */ = { + isa = PBXGroup; + children = ( + 4652132916ACF9D5003635AB /* GADAdMobExtras.h */, + 4652132A16ACF9D5003635AB /* GADAdNetworkExtras.h */, + 4652132B16ACF9D5003635AB /* GADAdSize.h */, + 4652132C16ACF9D5003635AB /* GADBannerView.h */, + 4652132D16ACF9D5003635AB /* GADBannerViewDelegate.h */, + 4652132E16ACF9D5003635AB /* GADInterstitial.h */, + 4652132F16ACF9D5003635AB /* GADInterstitialDelegate.h */, + 4652133016ACF9D5003635AB /* GADRequest.h */, + 4652133116ACF9D5003635AB /* GADRequestError.h */, + 4652133316ACF9D5003635AB /* libGoogleAdMobAds.a */, + ); + name = AdMob; + path = ../AdMob; + sourceTree = SOURCE_ROOT; + }; + 46B9177F14425C5F007EF823 = { + isa = PBXGroup; + children = ( + 4642C0A6167CFB040039EE16 /* Default-568h@2x.png */, + 465212CF16ACF9D5003635AB /* AdMob */, + 4641EBAB167EA96B00A4E590 /* LARSAdController */, + 46B9179414425C5F007EF823 /* BannerViewAdDemo */, + 46B9178D14425C5F007EF823 /* Frameworks */, + 46B9178B14425C5F007EF823 /* Products */, + ); + sourceTree = ""; + }; + 46B9178B14425C5F007EF823 /* Products */ = { + isa = PBXGroup; + children = ( + 46B9178A14425C5F007EF823 /* BannerViewAdDemo.app */, + ); + name = Products; + sourceTree = ""; + }; + 46B9178D14425C5F007EF823 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 4691CC6E165202A700559F58 /* StoreKit.framework */, + 465B42961623820900CBC997 /* AdSupport.framework */, + 46C1EAFB154C706300EBFEF1 /* MessageUI.framework */, + 46C1EAF9154C705E00EBFEF1 /* AudioToolbox.framework */, + 46C1EAF7154C703000EBFEF1 /* SystemConfiguration.framework */, + 46C1EAF5154C702A00EBFEF1 /* iAd.framework */, + 46B9178E14425C5F007EF823 /* UIKit.framework */, + 46B9179014425C5F007EF823 /* Foundation.framework */, + 46B9179214425C5F007EF823 /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 46B9179414425C5F007EF823 /* BannerViewAdDemo */ = { + isa = PBXGroup; + children = ( + AAAFED1A17CFEC5800D7FCCC /* LARSAppDelegate.h */, + AAAFED1B17CFEC5800D7FCCC /* LARSAppDelegate.m */, + AAAFED1C17CFEC5800D7FCCC /* LARSExampleViewController.h */, + AAAFED1D17CFEC5800D7FCCC /* LARSExampleViewController.m */, + 46B9179514425C60007EF823 /* Supporting Files */, + ); + name = BannerViewAdDemo; + path = adcontrollerdemo; + sourceTree = ""; + }; + 46B9179514425C60007EF823 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + AAAFED2017CFEC7E00D7FCCC /* BannerViewAdDemo-Info.plist */, + AAAFED2117CFEC7E00D7FCCC /* BannerViewAdDemo-Prefix.pch */, + AAAFED2217CFEC7E00D7FCCC /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 46B9178914425C5F007EF823 /* BannerViewAdDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 46B917B414425C60007EF823 /* Build configuration list for PBXNativeTarget "BannerViewAdDemo" */; + buildPhases = ( + 46B9178614425C5F007EF823 /* Sources */, + 46B9178714425C5F007EF823 /* Frameworks */, + 46B9178814425C5F007EF823 /* Resources */, + 4691CC68164EC49200559F58 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = BannerViewAdDemo; + productName = adcontrollerdemo; + productReference = 46B9178A14425C5F007EF823 /* BannerViewAdDemo.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 46B9178114425C5F007EF823 /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = LARS; + LastUpgradeCheck = 0450; + ORGANIZATIONNAME = theonlylars; + }; + buildConfigurationList = 46B9178414425C5F007EF823 /* Build configuration list for PBXProject "BannerViewAdDemo" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 46B9177F14425C5F007EF823; + productRefGroup = 46B9178B14425C5F007EF823 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 46B9178914425C5F007EF823 /* BannerViewAdDemo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 46B9178814425C5F007EF823 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4642C0A7167CFB040039EE16 /* Default-568h@2x.png in Resources */, + AAAFED2317CFEC7E00D7FCCC /* BannerViewAdDemo-Info.plist in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 4691CC68164EC49200559F58 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "KEYWORDS=\"TODO:|FIXME:|\\?\\?\\?:|\\!\\!\\!:\"\nfind \"${SRCROOT}/../..\" \\( -name \"*.h\" -or -name \"*.m\" \\) -print0 | \\\nxargs -0 egrep --with-filename --line-number --only-matching \"($KEYWORDS).*\\$\" | \\\nperl -p -e \"s/($KEYWORDS)/ warning: \\$1/\""; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 46B9178614425C5F007EF823 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4641EBB5167EA96B00A4E590 /* LARSAdController.m in Sources */, + 4641EBB7167EA96B00A4E590 /* TOLAdAdapteriAds.m in Sources */, + 4641EBB8167EA96B00A4E590 /* TOLAdViewController.m in Sources */, + 46F8742016915DDF001A2DF8 /* TOLAdAdapterGoogleAds.m in Sources */, + AAAFED1E17CFEC5800D7FCCC /* LARSAppDelegate.m in Sources */, + AAAFED1F17CFEC5800D7FCCC /* LARSExampleViewController.m in Sources */, + AAAFED2417CFEC7E00D7FCCC /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 46B917B214425C60007EF823 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_OBJCPP_ARC_ABI = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + PROVISIONING_PROFILE = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 46B917B314425C60007EF823 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_OBJCPP_ARC_ABI = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + PROVISIONING_PROFILE = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 46B917B514425C60007EF823 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BannerViewAdDemo/BannerViewAdDemo-Prefix.pch"; + INFOPLIST_FILE = "BannerViewAdDemo/BannerViewAdDemo-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../AdMob\"/**", + "\"$(SRCROOT)/../AdMob/Add-ons/GoogleAnalyticsiOS_2.0beta3/Library\"", + "\"$(SRCROOT)/../AdMob\"", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = BannerViewAdDemo; + PROVISIONING_PROFILE = ""; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 46B917B614425C60007EF823 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BannerViewAdDemo/BannerViewAdDemo-Prefix.pch"; + INFOPLIST_FILE = "BannerViewAdDemo/BannerViewAdDemo-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../AdMob\"/**", + "\"$(SRCROOT)/../AdMob/Add-ons/GoogleAnalyticsiOS_2.0beta3/Library\"", + "\"$(SRCROOT)/../AdMob\"", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = BannerViewAdDemo; + PROVISIONING_PROFILE = ""; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 46B9178414425C5F007EF823 /* Build configuration list for PBXProject "BannerViewAdDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 46B917B214425C60007EF823 /* Debug */, + 46B917B314425C60007EF823 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 46B917B414425C60007EF823 /* Build configuration list for PBXNativeTarget "BannerViewAdDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 46B917B514425C60007EF823 /* Debug */, + 46B917B614425C60007EF823 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 46B9178114425C5F007EF823 /* Project object */; +} diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewAdDemo-Info.plist b/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewAdDemo-Info.plist new file mode 100644 index 0000000..d39878f --- /dev/null +++ b/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewAdDemo-Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + com.theonlylars.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewAdDemo-Prefix.pch b/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewAdDemo-Prefix.pch new file mode 100644 index 0000000..b63d17e --- /dev/null +++ b/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewAdDemo-Prefix.pch @@ -0,0 +1,18 @@ +// +// Prefix header for all source files of the 'adcontrollerdemo' target in the 'adcontrollerdemo' project +// + +#import + +#ifndef __IPHONE_4_0 +#warning "This project uses features only available in iOS SDK 4.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif + +#ifndef LARSADCONTROLLER_DEBUG +#define LARSADCONTROLLER_DEBUG +#endif diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/LARSAppDelegate.h b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSAppDelegate.h new file mode 100644 index 0000000..4c6f0b0 --- /dev/null +++ b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSAppDelegate.h @@ -0,0 +1,19 @@ +// +// LARSAppDelegate.h +// adcontrollerdemo +// +// Created by Lars on 10/9/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface LARSAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@property (strong, nonatomic) UINavigationController *navigationController; + +@property (strong, nonatomic) UISplitViewController *splitViewController; + +@end diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/LARSAppDelegate.m b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSAppDelegate.m new file mode 100644 index 0000000..6a88532 --- /dev/null +++ b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSAppDelegate.m @@ -0,0 +1,98 @@ +// +// LARSAppDelegate.m +// adcontrollerdemo +// +// Created by Lars on 10/9/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "LARSAppDelegate.h" +#import "LARSExampleViewController.h" +#import "LARSAdController.h" +#import "TOLAdAdapterGoogleAds.h" +#import "TOLAdAdapteriAds.h" + +@implementation LARSAppDelegate + +@synthesize window = _window; +@synthesize navigationController = _navigationController; +@synthesize splitViewController = _splitViewController; + +- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + [self launch]; + + return YES; +} + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ + [self launch]; + + return YES; +} + +- (void)launch{ + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + +// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notified:) name:nil object:nil]; + + //This publisher id is a test account setup to test google ads since there is no good way to only send test ads without one - ad request will simply fail + [[LARSAdController sharedManager] registerAdClass:[TOLAdAdapterGoogleAds class] + withPublisherId:@"a14e55c99c24b43"]; + [[LARSAdController sharedManager] registerAdClass:[TOLAdAdapteriAds class]]; + + + + LARSExampleViewController *root = [[LARSExampleViewController alloc] init]; + [self.window setRootViewController:root]; + + [self.window makeKeyAndVisible]; + }); +} + +- (void)notified:(NSNotification *)note{ + NSLog(@"Note: %@", note); +} + +- (void)applicationWillResignActive:(UIApplication *)application +{ + /* + Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + */ +} + +- (void)applicationDidEnterBackground:(UIApplication *)application +{ + /* + Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + */ +} + +- (void)applicationWillEnterForeground:(UIApplication *)application +{ + /* + Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + */ +} + +- (void)applicationDidBecomeActive:(UIApplication *)application +{ + /* + Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + */ +} + +- (void)applicationWillTerminate:(UIApplication *)application +{ + /* + Called when the application is about to terminate. + Save data if appropriate. + See also applicationDidEnterBackground:. + */ +} + +@end diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.h b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.h new file mode 100644 index 0000000..5c4a290 --- /dev/null +++ b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.h @@ -0,0 +1,19 @@ +// +// LARSExampleViewController.h +// adcontrollerdemo +// +// Created by Lars Anderson on 4/28/12. +// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// + +#import +#import "TOLAdViewController.h" + +@interface LARSExampleViewController : TOLAdViewController + +@property (nonatomic, retain) UILabel *adVisibleLabel; +@property (nonatomic, retain) UIButton *bottomTestButton; +@property (nonatomic) BOOL bannerIsVisible; // shows if an ad is visible on this view or not +@property (nonatomic) float currentPushAmount; // the amount that the test button (or anything else) is being pushed up at the moment + +@end diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.m b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.m new file mode 100644 index 0000000..a4a4916 --- /dev/null +++ b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.m @@ -0,0 +1,143 @@ +// +// LARSExampleViewController.m +// adcontrollerdemo +// +// Created by Lars Anderson on 4/28/12. +// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// + +#import "LARSExampleViewController.h" +#import "LARSAdController.h" +#import "TOLAdAdapter.h" + +@interface LARSExampleViewController () + +@end + +@implementation LARSExampleViewController + +- (void)loadView{ + UIView *view = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds]; + view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + [view setBackgroundColor:[UIColor orangeColor]]; + + self.adVisibleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.f, 0.f, 200.f, 50.f)]; + self.adVisibleLabel.text = @"Ad not visible"; + + [view addSubview:self.adVisibleLabel]; + + + float buttonHeight = 50.0f; + float buttonWidth = view.frame.size.width - 20.0f; + + // create and configure the test button at the bottom of the screen + self.bottomTestButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + self.bottomTestButton.center = CGPointMake(0.0, 0.0); + self.bottomTestButton.frame = CGRectMake(10.0f, view.frame.size.height - (buttonHeight + 30.0f), buttonWidth, buttonHeight); + [self.bottomTestButton setTitle:@"this button should move up and down when an ad is shown or hidden" forState:UIControlStateNormal]; + self.bottomTestButton.titleLabel.lineBreakMode = NSLineBreakByWordWrapping; + self.bottomTestButton.titleLabel.textAlignment = NSTextAlignmentCenter; + + [view addSubview:self.bottomTestButton]; + + self.view = view; +} + +- (void)viewDidLoad{ + [super viewDidLoad]; + + self.adVisibleLabel.center = CGPointMake(CGRectGetWidth(self.view.frame)/2, CGRectGetHeight(self.view.frame)/2); + self.adVisibleLabel.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight; + + [[LARSAdController sharedManager] addObserver:self + forKeyPath:kLARSAdObserverKeyPathIsAdVisible + options:NSKeyValueObservingOptionNew + context:nil]; + + self.bannerIsVisible = NO; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{ + if ([keyPath isEqualToString:kLARSAdObserverKeyPathIsAdVisible]) { + NSLog(@"Observing keypath \"%@\"", keyPath); + + + BOOL anyAdsVisible = [change[NSKeyValueChangeNewKey] boolValue]; + + // get a reference to the banner that is currently visible + UIView *bannerView; + + NSArray *instances = [[[LARSAdController sharedManager] adapterInstances] allValues]; + for (id adapterInstance in instances) { + if (adapterInstance.adVisible) { + bannerView = adapterInstance.bannerView; + } + } + + if (anyAdsVisible) { + self.adVisibleLabel.text = @"Ad is visible"; + + // an add either appeared for the first time or replaced an existing one. + // either way, figure out how high to move the button, and move it + float height = bannerView.frame.size.height; + float padding = 0.0f; + self.currentPushAmount = height + padding; + + self.bannerIsVisible = YES; + [UIView animateWithDuration:0.25f animations:^(void) { + CGRect screenRect = [[UIScreen mainScreen] bounds]; + + [self.bottomTestButton setFrame:CGRectMake(self.bottomTestButton.frame.origin.x, + screenRect.size.height - (self.currentPushAmount + self.bottomTestButton.frame.size.height + 30.0f), + self.bottomTestButton.frame.size.width, + self.bottomTestButton.frame.size.height)]; + }]; + + } else { + self.adVisibleLabel.text = @"Ad not visible"; + + // no ads are visible, but if the banner is still showing, so move it back down + if (self.bannerIsVisible) { + self.bannerIsVisible = NO; + [UIView animateWithDuration:0.25f animations:^(void) { + [self.bottomTestButton setFrame:CGRectMake(self.bottomTestButton.frame.origin.x, + self.bottomTestButton.frame.origin.y + self.currentPushAmount, + self.bottomTestButton.frame.size.width, + self.bottomTestButton.frame.size.height)]; + }]; + } + } + } +} + +- (void)dealloc{ + [[LARSAdController sharedManager] removeObserver:self forKeyPath:kLARSAdObserverKeyPathIsAdVisible]; +} + +/* If this view controller did not inherit from TOLAdViewController, then you would need to uncomment the below method and implement adding the ad container to the view yourself. You will also need to uncomment line 10 to import the class. + */ +/* + - (void)viewWillAppear:(BOOL)animated{ + [super viewWillAppear:animated]; + + [[LARSAdController sharedManager] addAdContainerToViewInViewController:self]; + } + */ + +//Deprecated +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0 +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{ + return (toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); +} +#endif + +//New iOS 6 stuff +- (BOOL)shouldAutorotate{ + return YES; +} + +- (NSUInteger)supportedInterfaceOrientations{ + return UIInterfaceOrientationMaskAllButUpsideDown; +} + +@end diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/en.lproj/InfoPlist.strings b/Example/BannerViewAdDemo/BannerViewAdDemo/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Example/BannerViewAdDemo/BannerViewAdDemo/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/main.m b/Example/BannerViewAdDemo/BannerViewAdDemo/main.m new file mode 100644 index 0000000..95e63e5 --- /dev/null +++ b/Example/BannerViewAdDemo/BannerViewAdDemo/main.m @@ -0,0 +1,18 @@ +// +// main.m +// adcontrollerdemo +// +// Created by Lars on 10/9/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "LARSAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([LARSAppDelegate class])); + } +} diff --git a/Example/BannerViewAdDemo/Default-568h@2x.png b/Example/BannerViewAdDemo/Default-568h@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0891b7aabfcf3422423b109c8beed2bab838c607 GIT binary patch literal 18594 zcmeI4X;f257Jx&9fS`ixvS;&$x8J@slQFSel)6zJN=?13FB7H(lQjRkSy8x_-S~tvu2gzn1oS+dLcF#eqtq$ z%tf9TTvX?`)R@}3uBI;jzS-=ZR-Td&MHaS&;!0?Ni*#$#`n*~CcQK)Q9vAQ~TUpnI!j)a2biYK^R)M~A5wUDZhx?ULMX z3x1P&qt=trOY6P2U67L=m=U?F|5#Uj(eCueNTZaHs_ceWiHeET+j+tp3Jt9g(ekqP z2WOvfR{qV+9r+o4J5?qK>7;;^+I7tGv-i)es$X_D=EoKF+S?zsyj^oRFElP}c}JT< zd8SUs-?O?}2YD#ngKbnHgzHBcboxK_2r9l(?eNCl-pEzkJm}fY?WC*jnS?VBE4EpY zO$fEejz6fU;W2Kl>JeQBZBl-%Irg`obSlg*@4QB;Dd1H7^Oi5wvt4d{RZ!8Og?^aE z)k0$1g+V3fd(gdQ3d&q2q-FL*uy#}|bc^=VhFsl0jBgUGJ+-s3U8MK9A!YJJMxpci z5hJ%|{DwV48fZn0{n5l$N_KcSb#NKE4plB`9I6Zt=Z!~-zw0{9tg$L&Ju1F0X)Cy8 zKF;(&lJ>x)Jw(=;p~sF(Sd9VWGwFE2rnyS9!f^DZ8+aCLq zQ};>lcJ1GDLqjm6Hd>|Eabno@P`~Bn(~6^aD_#yoEH(a?Nm1S<;S+hSxI5d16^<1lEM3NPFi zkqPrpL)+ zgnseFikg`gJVBha1&7C4;O6>h=dt~`ND+;Zd?W(4v2JIb7Pt>Td42%M-Ju-XAH#Pns762L}K3 zDhvsRqN0Ni(1UrishD2YvV?4*h2iFj$+&N||Fn$4n|^NSU+o?~jq`0jVQt8T9l{7b zXiwwODFh2V!Q6sqP9S>WH$oOf$N~=d0-bqTlD61!=`&0eAP-F>XN?*|gtOXX{ zQVTWyYo4ZK0GAw!GHf|pz9`D;-bbb*5LBX*{bnz|+)$@&P9|ORM2o?95{;ejvo&r- zq8cBhTN6nn)7~W>54U)%-F_-b?YKdfk5I8MHcuzBD5)!;yv#Z&R&^y=@=>VTIMy#r zX&U<=BsPkdqcMe<_}2+>H%XKyrr5ZR8_KVe>ZqYN z^=^~TFD};;rHJ$U;{~w^hYojl4hRI@SH$^K{YEo=sg)WY87r!*7blQK&qnpDo0`Vn zkl)9u9g=mCh&ZCJS(L4yN3k0kQ zuvg$h2KEEk51T+O0JQ+r0`R>g{jvqM0Mr6d3qUOZwE!?PI7HY@CE|dr sfw?Q;rAv?G4&^^8-z_>&sWXMxvD*gPOU4CBe-*@OtE+wfmVJNyHv)PfH~;_u literal 0 HcmV?d00001 From cf576b188600e372dfcf23b41e907278b9645366 Mon Sep 17 00:00:00 2001 From: Paul Cezanne Date: Thu, 29 Aug 2013 17:59:37 -0400 Subject: [PATCH 2/4] initial commit of BannerViewAdDemo --- .../project.pbxproj | 34 ++- .../BannerViewAdDemo/BannerViewController.h | 63 ++++++ .../BannerViewAdDemo/BannerViewController.m | 202 +++++++++++++++++ .../BannerViewAdDemo/LARSAppDelegate.m | 18 +- .../LARSBannerViewController.h | 13 ++ .../LARSBannerViewController.m | 55 +++++ .../LARSBannerViewController.xib | 206 ++++++++++++++++++ .../LARSExampleViewController.h | 19 -- .../LARSExampleViewController.m | 143 ------------ .../BannerViewAdDemo/Default-568h@2x copy.png | Bin 0 -> 18594 bytes Example/BannerViewAdDemo/Default.png | Bin 0 -> 18594 bytes Example/BannerViewAdDemo/Default@2x.png | Bin 0 -> 18594 bytes 12 files changed, 579 insertions(+), 174 deletions(-) create mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewController.h create mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewController.m create mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo/LARSBannerViewController.h create mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo/LARSBannerViewController.m create mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo/LARSBannerViewController.xib delete mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.h delete mode 100644 Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.m create mode 100644 Example/BannerViewAdDemo/Default-568h@2x copy.png create mode 100644 Example/BannerViewAdDemo/Default.png create mode 100644 Example/BannerViewAdDemo/Default@2x.png diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo.xcodeproj/project.pbxproj b/Example/BannerViewAdDemo/BannerViewAdDemo.xcodeproj/project.pbxproj index e2ee8b9..82fee50 100644 --- a/Example/BannerViewAdDemo/BannerViewAdDemo.xcodeproj/project.pbxproj +++ b/Example/BannerViewAdDemo/BannerViewAdDemo.xcodeproj/project.pbxproj @@ -23,9 +23,14 @@ 46C1EAFC154C706300EBFEF1 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46C1EAFB154C706300EBFEF1 /* MessageUI.framework */; }; 46F8742016915DDF001A2DF8 /* TOLAdAdapterGoogleAds.m in Sources */ = {isa = PBXBuildFile; fileRef = 46F8741F16915DDF001A2DF8 /* TOLAdAdapterGoogleAds.m */; }; AAAFED1E17CFEC5800D7FCCC /* LARSAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AAAFED1B17CFEC5800D7FCCC /* LARSAppDelegate.m */; }; - AAAFED1F17CFEC5800D7FCCC /* LARSExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AAAFED1D17CFEC5800D7FCCC /* LARSExampleViewController.m */; }; AAAFED2317CFEC7E00D7FCCC /* BannerViewAdDemo-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = AAAFED2017CFEC7E00D7FCCC /* BannerViewAdDemo-Info.plist */; }; AAAFED2417CFEC7E00D7FCCC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AAAFED2217CFEC7E00D7FCCC /* main.m */; }; + AAAFED2817CFEE9000D7FCCC /* BannerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AAAFED2717CFEE9000D7FCCC /* BannerViewController.m */; }; + AAECFE4417CFF291007B76D6 /* LARSBannerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AAECFE4217CFF291007B76D6 /* LARSBannerViewController.m */; }; + AAECFE4517CFF291007B76D6 /* LARSBannerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AAECFE4317CFF291007B76D6 /* LARSBannerViewController.xib */; }; + AAECFE4717CFF438007B76D6 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AAECFE4617CFF438007B76D6 /* Default@2x.png */; }; + AAECFE4917CFF44A007B76D6 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AAECFE4817CFF44A007B76D6 /* Default-568h@2x.png */; }; + AAECFE4B17CFF47D007B76D6 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = AAECFE4A17CFF47D007B76D6 /* Default.png */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -61,11 +66,17 @@ 46F8741F16915DDF001A2DF8 /* TOLAdAdapterGoogleAds.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TOLAdAdapterGoogleAds.m; sourceTree = ""; }; AAAFED1A17CFEC5800D7FCCC /* LARSAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LARSAppDelegate.h; path = BannerViewAdDemo/LARSAppDelegate.h; sourceTree = SOURCE_ROOT; }; AAAFED1B17CFEC5800D7FCCC /* LARSAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LARSAppDelegate.m; path = BannerViewAdDemo/LARSAppDelegate.m; sourceTree = SOURCE_ROOT; }; - AAAFED1C17CFEC5800D7FCCC /* LARSExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LARSExampleViewController.h; path = BannerViewAdDemo/LARSExampleViewController.h; sourceTree = SOURCE_ROOT; }; - AAAFED1D17CFEC5800D7FCCC /* LARSExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LARSExampleViewController.m; path = BannerViewAdDemo/LARSExampleViewController.m; sourceTree = SOURCE_ROOT; }; AAAFED2017CFEC7E00D7FCCC /* BannerViewAdDemo-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "BannerViewAdDemo-Info.plist"; path = "BannerViewAdDemo/BannerViewAdDemo-Info.plist"; sourceTree = SOURCE_ROOT; }; AAAFED2117CFEC7E00D7FCCC /* BannerViewAdDemo-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "BannerViewAdDemo-Prefix.pch"; path = "BannerViewAdDemo/BannerViewAdDemo-Prefix.pch"; sourceTree = SOURCE_ROOT; }; AAAFED2217CFEC7E00D7FCCC /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = BannerViewAdDemo/main.m; sourceTree = SOURCE_ROOT; }; + AAAFED2617CFEE9000D7FCCC /* BannerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BannerViewController.h; path = BannerViewAdDemo/BannerViewController.h; sourceTree = SOURCE_ROOT; }; + AAAFED2717CFEE9000D7FCCC /* BannerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BannerViewController.m; path = BannerViewAdDemo/BannerViewController.m; sourceTree = SOURCE_ROOT; }; + AAECFE4117CFF291007B76D6 /* LARSBannerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LARSBannerViewController.h; path = BannerViewAdDemo/LARSBannerViewController.h; sourceTree = SOURCE_ROOT; }; + AAECFE4217CFF291007B76D6 /* LARSBannerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LARSBannerViewController.m; path = BannerViewAdDemo/LARSBannerViewController.m; sourceTree = SOURCE_ROOT; }; + AAECFE4317CFF291007B76D6 /* LARSBannerViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = LARSBannerViewController.xib; path = BannerViewAdDemo/LARSBannerViewController.xib; sourceTree = SOURCE_ROOT; }; + AAECFE4617CFF438007B76D6 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; + AAECFE4817CFF44A007B76D6 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + AAECFE4A17CFF47D007B76D6 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -135,6 +146,9 @@ 46B9177F14425C5F007EF823 = { isa = PBXGroup; children = ( + AAECFE4A17CFF47D007B76D6 /* Default.png */, + AAECFE4817CFF44A007B76D6 /* Default-568h@2x.png */, + AAECFE4617CFF438007B76D6 /* Default@2x.png */, 4642C0A6167CFB040039EE16 /* Default-568h@2x.png */, 465212CF16ACF9D5003635AB /* AdMob */, 4641EBAB167EA96B00A4E590 /* LARSAdController */, @@ -173,9 +187,12 @@ children = ( AAAFED1A17CFEC5800D7FCCC /* LARSAppDelegate.h */, AAAFED1B17CFEC5800D7FCCC /* LARSAppDelegate.m */, - AAAFED1C17CFEC5800D7FCCC /* LARSExampleViewController.h */, - AAAFED1D17CFEC5800D7FCCC /* LARSExampleViewController.m */, + AAAFED2617CFEE9000D7FCCC /* BannerViewController.h */, + AAAFED2717CFEE9000D7FCCC /* BannerViewController.m */, 46B9179514425C60007EF823 /* Supporting Files */, + AAECFE4117CFF291007B76D6 /* LARSBannerViewController.h */, + AAECFE4217CFF291007B76D6 /* LARSBannerViewController.m */, + AAECFE4317CFF291007B76D6 /* LARSBannerViewController.xib */, ); name = BannerViewAdDemo; path = adcontrollerdemo; @@ -246,6 +263,10 @@ files = ( 4642C0A7167CFB040039EE16 /* Default-568h@2x.png in Resources */, AAAFED2317CFEC7E00D7FCCC /* BannerViewAdDemo-Info.plist in Resources */, + AAECFE4517CFF291007B76D6 /* LARSBannerViewController.xib in Resources */, + AAECFE4717CFF438007B76D6 /* Default@2x.png in Resources */, + AAECFE4917CFF44A007B76D6 /* Default-568h@2x.png in Resources */, + AAECFE4B17CFF47D007B76D6 /* Default.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -277,8 +298,9 @@ 4641EBB8167EA96B00A4E590 /* TOLAdViewController.m in Sources */, 46F8742016915DDF001A2DF8 /* TOLAdAdapterGoogleAds.m in Sources */, AAAFED1E17CFEC5800D7FCCC /* LARSAppDelegate.m in Sources */, - AAAFED1F17CFEC5800D7FCCC /* LARSExampleViewController.m in Sources */, AAAFED2417CFEC7E00D7FCCC /* main.m in Sources */, + AAAFED2817CFEE9000D7FCCC /* BannerViewController.m in Sources */, + AAECFE4417CFF291007B76D6 /* LARSBannerViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewController.h b/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewController.h new file mode 100644 index 0000000..335e800 --- /dev/null +++ b/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewController.h @@ -0,0 +1,63 @@ +/* + File: BannerViewController.h +Abstract: A container view controller that manages an ADBannerView and a content view controller + Version: 2.2 + +Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple +Inc. ("Apple") in consideration of your agreement to the following +terms, and your use, installation, modification or redistribution of +this Apple software constitutes acceptance of these terms. If you do +not agree with these terms, please do not use, install, modify or +redistribute this Apple software. + +In consideration of your agreement to abide by the following terms, and +subject to these terms, Apple grants you a personal, non-exclusive +license, under Apple's copyrights in this original Apple software (the +"Apple Software"), to use, reproduce, modify and redistribute the Apple +Software, with or without modifications, in source and/or binary forms; +provided that if you redistribute the Apple Software in its entirety and +without modifications, you must retain this notice and the following +text and disclaimers in all such redistributions of the Apple Software. +Neither the name, trademarks, service marks or logos of Apple Inc. may +be used to endorse or promote products derived from the Apple Software +without specific prior written permission from Apple. Except as +expressly stated in this notice, no other rights or licenses, express or +implied, are granted by Apple herein, including but not limited to any +patent rights that may be infringed by your derivative works or by other +works in which the Apple Software may be incorporated. + +The Apple Software is provided by Apple on an "AS IS" basis. APPLE +MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION +THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND +OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. + +IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, +MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED +AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), +STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +Copyright (C) 2013 Apple Inc. All Rights Reserved. + +*/ + +// Modified by Paul Cezanne, Enki Labs, +// Changes Copyright (C) 2013 Paul Cezanne +// Changes released under the above Apple license + +#import +#import "TOLAdViewController.h" + +#define KVO_AD_VISIBLE @"KVO_AD_VISIBLE" + +@interface BannerViewController : TOLAdViewController + +- (instancetype)initWithContentViewController:(UIViewController *)contentController; + +- (void) turnBannersOff; + +@end diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewController.m b/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewController.m new file mode 100644 index 0000000..6c1b298 --- /dev/null +++ b/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewController.m @@ -0,0 +1,202 @@ +/* + File: BannerViewController.m +Abstract: A container view controller that manages an ADBannerView and a content view controller + Version: 2.2 + +Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple +Inc. ("Apple") in consideration of your agreement to the following +terms, and your use, installation, modification or redistribution of +this Apple software constitutes acceptance of these terms. If you do +not agree with these terms, please do not use, install, modify or +redistribute this Apple software. + +In consideration of your agreement to abide by the following terms, and +subject to these terms, Apple grants you a personal, non-exclusive +license, under Apple's copyrights in this original Apple software (the +"Apple Software"), to use, reproduce, modify and redistribute the Apple +Software, with or without modifications, in source and/or binary forms; +provided that if you redistribute the Apple Software in its entirety and +without modifications, you must retain this notice and the following +text and disclaimers in all such redistributions of the Apple Software. +Neither the name, trademarks, service marks or logos of Apple Inc. may +be used to endorse or promote products derived from the Apple Software +without specific prior written permission from Apple. Except as +expressly stated in this notice, no other rights or licenses, express or +implied, are granted by Apple herein, including but not limited to any +patent rights that may be infringed by your derivative works or by other +works in which the Apple Software may be incorporated. + +The Apple Software is provided by Apple on an "AS IS" basis. APPLE +MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION +THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND +OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. + +IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, +MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED +AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), +STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +Copyright (C) 2013 Apple Inc. All Rights Reserved. + +*/ + +// Modified by Paul Cezanne, Enki Labs, +// Changes Copyright (C) 2013 Paul Cezanne +// Changes released under the above Apple license + +#import "BannerViewController.h" +#import "LARSAdController.h" + + +#define kBgQueue dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) + +@implementation BannerViewController { + UIView *_bannerView; + UIViewController *_contentController; + BOOL isLoaded; + int adMobShadowHeight; +} + +- (instancetype)initWithContentViewController:(UIViewController *)contentController +{ + // If contentController is nil, -loadView is going to throw an exception when it attempts to setup + // containment of a nil view controller. Instead, throw the exception here and make it obvious + // what is wrong. + NSAssert(contentController != nil, @"Attempting to initialize a BannerViewController with a nil contentController."); + + self = [super init]; + if (self != nil) { + _contentController = contentController; + + // you can disable banner ads at startup if you are using in-app + // purchases here + // + // IAPHelper *sharedInstance = [//IAPHelper sharedInstance]; + //if ([sharedInstance showBannerAds]) { + if (YES) { + _bannerView = [[UIView alloc] initWithFrame:CGRectZero]; + } else { + _bannerView = nil; // not showing ads since the user has upgraded + } + _contentController = contentController; + } + + isLoaded = NO; + + // This is gross. AdMob ads that are placed at the bottom of the view + // have a 20 pixel shadow on top of them. So, if you slide your whole view + // upwards then you'll have a gap between the visual top of the ad and the + // bottom of your UI. + adMobShadowHeight = 0; + + [[LARSAdController sharedManager] addObserver:self + forKeyPath:kLARSAdObserverKeyPathIsAdVisible + options:0 + context:KVO_AD_VISIBLE]; + return self; +} + +- (void)loadView +{ + UIView *contentView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + + [contentView addSubview:_bannerView]; + + // Setup containment of the _contentController. + [self addChildViewController:_contentController]; + [contentView addSubview:_contentController.view]; + [_contentController didMoveToParentViewController:self]; + + self.view = contentView; +} + + +- (void)observeValueForKeyPath:(NSString *)keyPath + ofObject:(id)object + change:(NSDictionary *)change + context:(void *)context; +{ + //use the context to make sure this is a change in the address, + //because we may also be observing other things + if(context == KVO_AD_VISIBLE) { + NSNumber *isVisible = [object valueForKey:kLARSAdObserverKeyPathIsAdVisible]; + + if ([isVisible boolValue]) { + _bannerView.frame = [[LARSAdController sharedManager] containerView].frame; + + isLoaded = YES; + + // right now we need to know if the Adapter was an AdMob ad + // so we can do something about the shadow + } + } +} + +// you would call this method if, for example, you implemented in-app purchases +// and wanted to turn off all banners +- (void) turnBannersOff; +{ + [_bannerView removeFromSuperview]; + _bannerView = nil; + + [self.view setNeedsLayout]; + [self.view layoutIfNeeded]; +} + + +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0 +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return [_contentController shouldAutorotateToInterfaceOrientation:interfaceOrientation]; +} +#endif + +- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation +{ + return [_contentController preferredInterfaceOrientationForPresentation]; +} + +- (NSUInteger)supportedInterfaceOrientations +{ + return [_contentController supportedInterfaceOrientations]; +} + +- (void)viewDidLayoutSubviews +{ + // This method will be called whenever we receive a delegate callback + // from the banner view. + // (See the comments in -bannerViewDidLoadAd: and -bannerView:didFailToReceiveAdWithError:) + + CGRect contentFrame = self.view.bounds, bannerFrame = CGRectZero; +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0 + bannerFrame = _bannerView.frame; +#else + // If configured to support iOS >= 6.0 only, then we want to avoid currentContentSizeIdentifier as it is deprecated. + // Fortunately all we need to do is ask the banner for a size that fits into the layout area we are using. + // At this point in this method contentFrame=self.view.bounds, so we'll use that size for the layout. + bannerFrame.size = [_bannerView sizeThatFits:contentFrame.size]; +#endif + + // Check if the banner has an ad loaded and ready for display. Move the banner off + // screen if it does not have an ad. + if (isLoaded) { + contentFrame.size.height -= (bannerFrame.size.height - adMobShadowHeight); + bannerFrame.origin.y = contentFrame.size.height; + } else { + bannerFrame.origin.y = contentFrame.size.height; + } + _contentController.view.frame = contentFrame; + _bannerView.frame = bannerFrame; +} + +-(void) dealloc; +{ + [[LARSAdController sharedManager] removeObserver:self forKeyPath:kLARSAdObserverKeyPathIsAdVisible]; +} + +@end diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/LARSAppDelegate.m b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSAppDelegate.m index 6a88532..d56a9ba 100644 --- a/Example/BannerViewAdDemo/BannerViewAdDemo/LARSAppDelegate.m +++ b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSAppDelegate.m @@ -7,12 +7,18 @@ // #import "LARSAppDelegate.h" -#import "LARSExampleViewController.h" #import "LARSAdController.h" #import "TOLAdAdapterGoogleAds.h" #import "TOLAdAdapteriAds.h" +#import "LARSBannerViewController.h" +#import "BannerViewController.h" + + + +@implementation LARSAppDelegate { + BannerViewController *_bannerViewController; +} -@implementation LARSAppDelegate @synthesize window = _window; @synthesize navigationController = _navigationController; @@ -39,14 +45,14 @@ - (void)launch{ // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notified:) name:nil object:nil]; //This publisher id is a test account setup to test google ads since there is no good way to only send test ads without one - ad request will simply fail - [[LARSAdController sharedManager] registerAdClass:[TOLAdAdapterGoogleAds class] - withPublisherId:@"a14e55c99c24b43"]; + [[LARSAdController sharedManager] registerAdClass:[TOLAdAdapterGoogleAds class] withPublisherId:@"a14e55c99c24b43"]; [[LARSAdController sharedManager] registerAdClass:[TOLAdAdapteriAds class]]; + LARSBannerViewController *root = [[LARSBannerViewController alloc] initWithNibName:@"LARSBannerViewController" bundle:nil]; + _bannerViewController = [[BannerViewController alloc] initWithContentViewController:root]; - LARSExampleViewController *root = [[LARSExampleViewController alloc] init]; - [self.window setRootViewController:root]; + [self.window setRootViewController:_bannerViewController]; [self.window makeKeyAndVisible]; }); diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/LARSBannerViewController.h b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSBannerViewController.h new file mode 100644 index 0000000..36ab564 --- /dev/null +++ b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSBannerViewController.h @@ -0,0 +1,13 @@ +// +// LARSBannerViewController.h +// BannerViewAdDemo +// +// Created by Paul Cezanne on 8/29/13. +// Copyright (c) 2013 theonlylars. All rights reserved. +// + +#import + +@interface LARSBannerViewController : UIViewController + +@end diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/LARSBannerViewController.m b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSBannerViewController.m new file mode 100644 index 0000000..29f17e5 --- /dev/null +++ b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSBannerViewController.m @@ -0,0 +1,55 @@ +// +// LARSBannerViewController.m +// BannerViewAdDemo +// +// Created by Paul Cezanne on 8/29/13. +// Copyright (c) 2013 theonlylars. All rights reserved. +// + +#import "LARSBannerViewController.h" + +@interface LARSBannerViewController () + +@end + +@implementation LARSBannerViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view from its nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +//Deprecated +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0 +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{ + return (toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); +} +#endif + +//New iOS 6 stuff +- (BOOL)shouldAutorotate{ + return YES; +} + +- (NSUInteger)supportedInterfaceOrientations{ + return UIInterfaceOrientationMaskAllButUpsideDown; +} + + +@end diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/LARSBannerViewController.xib b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSBannerViewController.xib new file mode 100644 index 0000000..874a12c --- /dev/null +++ b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSBannerViewController.xib @@ -0,0 +1,206 @@ + + + + 1552 + 12E55 + 3084 + 1187.39 + 626.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 2083 + + + IBProxyObject + IBUILabel + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + + + 290 + {{20, 20}, {280, 21}} + + + + _NS:9 + NO + YES + 7 + NO + IBCocoaTouchFramework + This label is at the top + + 1 + MCAwIDAAA + darkTextColor + + + 0 + 1 + + 1 + 17 + + + Helvetica + 17 + 16 + + NO + + + + 266 + {{20, 507}, {280, 21}} + + + _NS:9 + NO + YES + 7 + NO + IBCocoaTouchFramework + At the bottom and will move + + + 0 + 1 + + + NO + + + {{0, 20}, {320, 548}} + + + + + 1 + MSAxIDAAA + + + + IBUIScreenMetrics + + YES + + + + + + {320, 568} + {568, 320} + + + IBCocoaTouchFramework + Retina 4 Full Screen + 2 + + IBCocoaTouchFramework + + + + + + + view + + + + 3 + + + + + + 0 + + + + + + 1 + + + + + + + + + -1 + + + File's Owner + + + -2 + + + + + 21 + + + + + 25 + + + + + + + LARSBannerViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 29 + + + + + LARSBannerViewController + UIViewController + + IBProjectSource + ./Classes/LARSBannerViewController.h + + + + + 0 + IBCocoaTouchFramework + YES + 3 + 2083 + + diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.h b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.h deleted file mode 100644 index 5c4a290..0000000 --- a/Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// LARSExampleViewController.h -// adcontrollerdemo -// -// Created by Lars Anderson on 4/28/12. -// Copyright (c) 2012 __MyCompanyName__. All rights reserved. -// - -#import -#import "TOLAdViewController.h" - -@interface LARSExampleViewController : TOLAdViewController - -@property (nonatomic, retain) UILabel *adVisibleLabel; -@property (nonatomic, retain) UIButton *bottomTestButton; -@property (nonatomic) BOOL bannerIsVisible; // shows if an ad is visible on this view or not -@property (nonatomic) float currentPushAmount; // the amount that the test button (or anything else) is being pushed up at the moment - -@end diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.m b/Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.m deleted file mode 100644 index a4a4916..0000000 --- a/Example/BannerViewAdDemo/BannerViewAdDemo/LARSExampleViewController.m +++ /dev/null @@ -1,143 +0,0 @@ -// -// LARSExampleViewController.m -// adcontrollerdemo -// -// Created by Lars Anderson on 4/28/12. -// Copyright (c) 2012 __MyCompanyName__. All rights reserved. -// - -#import "LARSExampleViewController.h" -#import "LARSAdController.h" -#import "TOLAdAdapter.h" - -@interface LARSExampleViewController () - -@end - -@implementation LARSExampleViewController - -- (void)loadView{ - UIView *view = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds]; - view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - [view setBackgroundColor:[UIColor orangeColor]]; - - self.adVisibleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.f, 0.f, 200.f, 50.f)]; - self.adVisibleLabel.text = @"Ad not visible"; - - [view addSubview:self.adVisibleLabel]; - - - float buttonHeight = 50.0f; - float buttonWidth = view.frame.size.width - 20.0f; - - // create and configure the test button at the bottom of the screen - self.bottomTestButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; - self.bottomTestButton.center = CGPointMake(0.0, 0.0); - self.bottomTestButton.frame = CGRectMake(10.0f, view.frame.size.height - (buttonHeight + 30.0f), buttonWidth, buttonHeight); - [self.bottomTestButton setTitle:@"this button should move up and down when an ad is shown or hidden" forState:UIControlStateNormal]; - self.bottomTestButton.titleLabel.lineBreakMode = NSLineBreakByWordWrapping; - self.bottomTestButton.titleLabel.textAlignment = NSTextAlignmentCenter; - - [view addSubview:self.bottomTestButton]; - - self.view = view; -} - -- (void)viewDidLoad{ - [super viewDidLoad]; - - self.adVisibleLabel.center = CGPointMake(CGRectGetWidth(self.view.frame)/2, CGRectGetHeight(self.view.frame)/2); - self.adVisibleLabel.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight; - - [[LARSAdController sharedManager] addObserver:self - forKeyPath:kLARSAdObserverKeyPathIsAdVisible - options:NSKeyValueObservingOptionNew - context:nil]; - - self.bannerIsVisible = NO; -} - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{ - if ([keyPath isEqualToString:kLARSAdObserverKeyPathIsAdVisible]) { - NSLog(@"Observing keypath \"%@\"", keyPath); - - - BOOL anyAdsVisible = [change[NSKeyValueChangeNewKey] boolValue]; - - // get a reference to the banner that is currently visible - UIView *bannerView; - - NSArray *instances = [[[LARSAdController sharedManager] adapterInstances] allValues]; - for (id adapterInstance in instances) { - if (adapterInstance.adVisible) { - bannerView = adapterInstance.bannerView; - } - } - - if (anyAdsVisible) { - self.adVisibleLabel.text = @"Ad is visible"; - - // an add either appeared for the first time or replaced an existing one. - // either way, figure out how high to move the button, and move it - float height = bannerView.frame.size.height; - float padding = 0.0f; - self.currentPushAmount = height + padding; - - self.bannerIsVisible = YES; - [UIView animateWithDuration:0.25f animations:^(void) { - CGRect screenRect = [[UIScreen mainScreen] bounds]; - - [self.bottomTestButton setFrame:CGRectMake(self.bottomTestButton.frame.origin.x, - screenRect.size.height - (self.currentPushAmount + self.bottomTestButton.frame.size.height + 30.0f), - self.bottomTestButton.frame.size.width, - self.bottomTestButton.frame.size.height)]; - }]; - - } else { - self.adVisibleLabel.text = @"Ad not visible"; - - // no ads are visible, but if the banner is still showing, so move it back down - if (self.bannerIsVisible) { - self.bannerIsVisible = NO; - [UIView animateWithDuration:0.25f animations:^(void) { - [self.bottomTestButton setFrame:CGRectMake(self.bottomTestButton.frame.origin.x, - self.bottomTestButton.frame.origin.y + self.currentPushAmount, - self.bottomTestButton.frame.size.width, - self.bottomTestButton.frame.size.height)]; - }]; - } - } - } -} - -- (void)dealloc{ - [[LARSAdController sharedManager] removeObserver:self forKeyPath:kLARSAdObserverKeyPathIsAdVisible]; -} - -/* If this view controller did not inherit from TOLAdViewController, then you would need to uncomment the below method and implement adding the ad container to the view yourself. You will also need to uncomment line 10 to import the class. - */ -/* - - (void)viewWillAppear:(BOOL)animated{ - [super viewWillAppear:animated]; - - [[LARSAdController sharedManager] addAdContainerToViewInViewController:self]; - } - */ - -//Deprecated -#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0 -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{ - return (toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); -} -#endif - -//New iOS 6 stuff -- (BOOL)shouldAutorotate{ - return YES; -} - -- (NSUInteger)supportedInterfaceOrientations{ - return UIInterfaceOrientationMaskAllButUpsideDown; -} - -@end diff --git a/Example/BannerViewAdDemo/Default-568h@2x copy.png b/Example/BannerViewAdDemo/Default-568h@2x copy.png new file mode 100644 index 0000000000000000000000000000000000000000..0891b7aabfcf3422423b109c8beed2bab838c607 GIT binary patch literal 18594 zcmeI4X;f257Jx&9fS`ixvS;&$x8J@slQFSel)6zJN=?13FB7H(lQjRkSy8x_-S~tvu2gzn1oS+dLcF#eqtq$ z%tf9TTvX?`)R@}3uBI;jzS-=ZR-Td&MHaS&;!0?Ni*#$#`n*~CcQK)Q9vAQ~TUpnI!j)a2biYK^R)M~A5wUDZhx?ULMX z3x1P&qt=trOY6P2U67L=m=U?F|5#Uj(eCueNTZaHs_ceWiHeET+j+tp3Jt9g(ekqP z2WOvfR{qV+9r+o4J5?qK>7;;^+I7tGv-i)es$X_D=EoKF+S?zsyj^oRFElP}c}JT< zd8SUs-?O?}2YD#ngKbnHgzHBcboxK_2r9l(?eNCl-pEzkJm}fY?WC*jnS?VBE4EpY zO$fEejz6fU;W2Kl>JeQBZBl-%Irg`obSlg*@4QB;Dd1H7^Oi5wvt4d{RZ!8Og?^aE z)k0$1g+V3fd(gdQ3d&q2q-FL*uy#}|bc^=VhFsl0jBgUGJ+-s3U8MK9A!YJJMxpci z5hJ%|{DwV48fZn0{n5l$N_KcSb#NKE4plB`9I6Zt=Z!~-zw0{9tg$L&Ju1F0X)Cy8 zKF;(&lJ>x)Jw(=;p~sF(Sd9VWGwFE2rnyS9!f^DZ8+aCLq zQ};>lcJ1GDLqjm6Hd>|Eabno@P`~Bn(~6^aD_#yoEH(a?Nm1S<;S+hSxI5d16^<1lEM3NPFi zkqPrpL)+ zgnseFikg`gJVBha1&7C4;O6>h=dt~`ND+;Zd?W(4v2JIb7Pt>Td42%M-Ju-XAH#Pns762L}K3 zDhvsRqN0Ni(1UrishD2YvV?4*h2iFj$+&N||Fn$4n|^NSU+o?~jq`0jVQt8T9l{7b zXiwwODFh2V!Q6sqP9S>WH$oOf$N~=d0-bqTlD61!=`&0eAP-F>XN?*|gtOXX{ zQVTWyYo4ZK0GAw!GHf|pz9`D;-bbb*5LBX*{bnz|+)$@&P9|ORM2o?95{;ejvo&r- zq8cBhTN6nn)7~W>54U)%-F_-b?YKdfk5I8MHcuzBD5)!;yv#Z&R&^y=@=>VTIMy#r zX&U<=BsPkdqcMe<_}2+>H%XKyrr5ZR8_KVe>ZqYN z^=^~TFD};;rHJ$U;{~w^hYojl4hRI@SH$^K{YEo=sg)WY87r!*7blQK&qnpDo0`Vn zkl)9u9g=mCh&ZCJS(L4yN3k0kQ zuvg$h2KEEk51T+O0JQ+r0`R>g{jvqM0Mr6d3qUOZwE!?PI7HY@CE|dr sfw?Q;rAv?G4&^^8-z_>&sWXMxvD*gPOU4CBe-*@OtE+wfmVJNyHv)PfH~;_u literal 0 HcmV?d00001 diff --git a/Example/BannerViewAdDemo/Default.png b/Example/BannerViewAdDemo/Default.png new file mode 100644 index 0000000000000000000000000000000000000000..0891b7aabfcf3422423b109c8beed2bab838c607 GIT binary patch literal 18594 zcmeI4X;f257Jx&9fS`ixvS;&$x8J@slQFSel)6zJN=?13FB7H(lQjRkSy8x_-S~tvu2gzn1oS+dLcF#eqtq$ z%tf9TTvX?`)R@}3uBI;jzS-=ZR-Td&MHaS&;!0?Ni*#$#`n*~CcQK)Q9vAQ~TUpnI!j)a2biYK^R)M~A5wUDZhx?ULMX z3x1P&qt=trOY6P2U67L=m=U?F|5#Uj(eCueNTZaHs_ceWiHeET+j+tp3Jt9g(ekqP z2WOvfR{qV+9r+o4J5?qK>7;;^+I7tGv-i)es$X_D=EoKF+S?zsyj^oRFElP}c}JT< zd8SUs-?O?}2YD#ngKbnHgzHBcboxK_2r9l(?eNCl-pEzkJm}fY?WC*jnS?VBE4EpY zO$fEejz6fU;W2Kl>JeQBZBl-%Irg`obSlg*@4QB;Dd1H7^Oi5wvt4d{RZ!8Og?^aE z)k0$1g+V3fd(gdQ3d&q2q-FL*uy#}|bc^=VhFsl0jBgUGJ+-s3U8MK9A!YJJMxpci z5hJ%|{DwV48fZn0{n5l$N_KcSb#NKE4plB`9I6Zt=Z!~-zw0{9tg$L&Ju1F0X)Cy8 zKF;(&lJ>x)Jw(=;p~sF(Sd9VWGwFE2rnyS9!f^DZ8+aCLq zQ};>lcJ1GDLqjm6Hd>|Eabno@P`~Bn(~6^aD_#yoEH(a?Nm1S<;S+hSxI5d16^<1lEM3NPFi zkqPrpL)+ zgnseFikg`gJVBha1&7C4;O6>h=dt~`ND+;Zd?W(4v2JIb7Pt>Td42%M-Ju-XAH#Pns762L}K3 zDhvsRqN0Ni(1UrishD2YvV?4*h2iFj$+&N||Fn$4n|^NSU+o?~jq`0jVQt8T9l{7b zXiwwODFh2V!Q6sqP9S>WH$oOf$N~=d0-bqTlD61!=`&0eAP-F>XN?*|gtOXX{ zQVTWyYo4ZK0GAw!GHf|pz9`D;-bbb*5LBX*{bnz|+)$@&P9|ORM2o?95{;ejvo&r- zq8cBhTN6nn)7~W>54U)%-F_-b?YKdfk5I8MHcuzBD5)!;yv#Z&R&^y=@=>VTIMy#r zX&U<=BsPkdqcMe<_}2+>H%XKyrr5ZR8_KVe>ZqYN z^=^~TFD};;rHJ$U;{~w^hYojl4hRI@SH$^K{YEo=sg)WY87r!*7blQK&qnpDo0`Vn zkl)9u9g=mCh&ZCJS(L4yN3k0kQ zuvg$h2KEEk51T+O0JQ+r0`R>g{jvqM0Mr6d3qUOZwE!?PI7HY@CE|dr sfw?Q;rAv?G4&^^8-z_>&sWXMxvD*gPOU4CBe-*@OtE+wfmVJNyHv)PfH~;_u literal 0 HcmV?d00001 diff --git a/Example/BannerViewAdDemo/Default@2x.png b/Example/BannerViewAdDemo/Default@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0891b7aabfcf3422423b109c8beed2bab838c607 GIT binary patch literal 18594 zcmeI4X;f257Jx&9fS`ixvS;&$x8J@slQFSel)6zJN=?13FB7H(lQjRkSy8x_-S~tvu2gzn1oS+dLcF#eqtq$ z%tf9TTvX?`)R@}3uBI;jzS-=ZR-Td&MHaS&;!0?Ni*#$#`n*~CcQK)Q9vAQ~TUpnI!j)a2biYK^R)M~A5wUDZhx?ULMX z3x1P&qt=trOY6P2U67L=m=U?F|5#Uj(eCueNTZaHs_ceWiHeET+j+tp3Jt9g(ekqP z2WOvfR{qV+9r+o4J5?qK>7;;^+I7tGv-i)es$X_D=EoKF+S?zsyj^oRFElP}c}JT< zd8SUs-?O?}2YD#ngKbnHgzHBcboxK_2r9l(?eNCl-pEzkJm}fY?WC*jnS?VBE4EpY zO$fEejz6fU;W2Kl>JeQBZBl-%Irg`obSlg*@4QB;Dd1H7^Oi5wvt4d{RZ!8Og?^aE z)k0$1g+V3fd(gdQ3d&q2q-FL*uy#}|bc^=VhFsl0jBgUGJ+-s3U8MK9A!YJJMxpci z5hJ%|{DwV48fZn0{n5l$N_KcSb#NKE4plB`9I6Zt=Z!~-zw0{9tg$L&Ju1F0X)Cy8 zKF;(&lJ>x)Jw(=;p~sF(Sd9VWGwFE2rnyS9!f^DZ8+aCLq zQ};>lcJ1GDLqjm6Hd>|Eabno@P`~Bn(~6^aD_#yoEH(a?Nm1S<;S+hSxI5d16^<1lEM3NPFi zkqPrpL)+ zgnseFikg`gJVBha1&7C4;O6>h=dt~`ND+;Zd?W(4v2JIb7Pt>Td42%M-Ju-XAH#Pns762L}K3 zDhvsRqN0Ni(1UrishD2YvV?4*h2iFj$+&N||Fn$4n|^NSU+o?~jq`0jVQt8T9l{7b zXiwwODFh2V!Q6sqP9S>WH$oOf$N~=d0-bqTlD61!=`&0eAP-F>XN?*|gtOXX{ zQVTWyYo4ZK0GAw!GHf|pz9`D;-bbb*5LBX*{bnz|+)$@&P9|ORM2o?95{;ejvo&r- zq8cBhTN6nn)7~W>54U)%-F_-b?YKdfk5I8MHcuzBD5)!;yv#Z&R&^y=@=>VTIMy#r zX&U<=BsPkdqcMe<_}2+>H%XKyrr5ZR8_KVe>ZqYN z^=^~TFD};;rHJ$U;{~w^hYojl4hRI@SH$^K{YEo=sg)WY87r!*7blQK&qnpDo0`Vn zkl)9u9g=mCh&ZCJS(L4yN3k0kQ zuvg$h2KEEk51T+O0JQ+r0`R>g{jvqM0Mr6d3qUOZwE!?PI7HY@CE|dr sfw?Q;rAv?G4&^^8-z_>&sWXMxvD*gPOU4CBe-*@OtE+wfmVJNyHv)PfH~;_u literal 0 HcmV?d00001 From 9b937211b8130963f1aa5a486a6aec705eb1d7ef Mon Sep 17 00:00:00 2001 From: Paul Cezanne Date: Thu, 29 Aug 2013 18:00:01 -0400 Subject: [PATCH 3/4] have the button hug the bottom so you can see the bug in landscape mode --- .../adcontrollerdemo/LARSExampleViewController.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Example/adcontrollerdemo/adcontrollerdemo/LARSExampleViewController.m b/Example/adcontrollerdemo/adcontrollerdemo/LARSExampleViewController.m index a4a4916..54e9e29 100644 --- a/Example/adcontrollerdemo/adcontrollerdemo/LARSExampleViewController.m +++ b/Example/adcontrollerdemo/adcontrollerdemo/LARSExampleViewController.m @@ -37,6 +37,7 @@ - (void)loadView{ [self.bottomTestButton setTitle:@"this button should move up and down when an ad is shown or hidden" forState:UIControlStateNormal]; self.bottomTestButton.titleLabel.lineBreakMode = NSLineBreakByWordWrapping; self.bottomTestButton.titleLabel.textAlignment = NSTextAlignmentCenter; + self.bottomTestButton.autoresizingMask = UIViewAutoresizingFlexibleTopMargin; [view addSubview:self.bottomTestButton]; From 8829d5d8414b813e09ae80238bb241f8f3174f8b Mon Sep 17 00:00:00 2001 From: pcezanne Date: Tue, 3 Sep 2013 15:52:19 -0400 Subject: [PATCH 4/4] handle ad failure also! --- .../BannerViewAdDemo/BannerViewAdDemo/BannerViewController.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewController.m b/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewController.m index 6c1b298..81c6cca 100644 --- a/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewController.m +++ b/Example/BannerViewAdDemo/BannerViewAdDemo/BannerViewController.m @@ -133,8 +133,12 @@ - (void)observeValueForKeyPath:(NSString *)keyPath // right now we need to know if the Adapter was an AdMob ad // so we can do something about the shadow + } else { + isLoaded = YES; } } + [self.view setNeedsLayout]; + [self.view layoutIfNeeded]; } // you would call this method if, for example, you implemented in-app purchases