diff --git a/ANSDK.xcodeproj/project.pbxproj b/ANSDK.xcodeproj/project.pbxproj index 635ddab33..78af7c6c9 100644 --- a/ANSDK.xcodeproj/project.pbxproj +++ b/ANSDK.xcodeproj/project.pbxproj @@ -93,6 +93,7 @@ /* Begin PBXFileReference section */ EC2E96D71911A147001A42EF /* ANANJAMImplementation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANANJAMImplementation.h; sourceTree = ""; }; EC2E96D81911A147001A42EF /* ANANJAMImplementation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANANJAMImplementation.m; sourceTree = ""; }; + 8A629C1D1912A68000A295CE /* ANBasicConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ANBasicConfig.h; sourceTree = ""; }; EC3905F8186693AA0017959C /* ANTargetingParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANTargetingParameters.h; sourceTree = ""; }; EC3905F9186693B50017959C /* ANTargetingParameters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANTargetingParameters.m; sourceTree = ""; }; EC3E5CDC1843C6D50070315E /* libANSDK.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libANSDK.a; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -247,13 +248,12 @@ EC3E5D141843C7560070315E /* internal */ = { isa = PBXGroup; children = ( - EC7AB08218887E5300C27B1E /* ANLogManager.m */, EC3E5D151843C7560070315E /* ANAdFetcher.h */, EC3E5D161843C7560070315E /* ANAdFetcher.m */, - EC3E5D171843C7560070315E /* ANAdResponse.h */, - EC3E5D181843C7560070315E /* ANAdResponse.m */, EC9B3449187DEB6900013F79 /* ANAdRequestUrl.h */, EC9B3448187DEB6900013F79 /* ANAdRequestUrl.m */, + EC3E5D171843C7560070315E /* ANAdResponse.h */, + EC3E5D181843C7560070315E /* ANAdResponse.m */, EC3E5D1A1843C7560070315E /* ANAdView.m */, EC3E5D1B1843C7560070315E /* ANAdViewDelegate.h */, EC3E5D1C1843C7560070315E /* ANAdWebViewController.h */, @@ -261,6 +261,7 @@ EC2E96D71911A147001A42EF /* ANANJAMImplementation.h */, EC2E96D81911A147001A42EF /* ANANJAMImplementation.m */, EC3E5D1E1843C7560070315E /* ANBannerAdView.m */, + 8A629C1D1912A68000A295CE /* ANBasicConfig.h */, EC3E5D1F1843C7560070315E /* ANBrowserViewController.h */, EC3E5D201843C7560070315E /* ANBrowserViewController.m */, EC3E5D231843C7560070315E /* ANGlobal.h */, @@ -273,6 +274,7 @@ EC3E5D2C1843C7560070315E /* ANLocation.m */, EC3E5D2D1843C7560070315E /* ANLogging.h */, EC3E5D2E1843C7560070315E /* ANLogging.m */, + EC7AB08218887E5300C27B1E /* ANLogManager.m */, EC3E5D2F1843C7560070315E /* ANMediatedAd.h */, EC3E5D301843C7560070315E /* ANMediatedAd.m */, EC3E5D311843C7560070315E /* ANMediationAdViewController.h */, diff --git a/ANSDKAdMob.xcodeproj/project.pbxproj b/ANSDKAdMob.xcodeproj/project.pbxproj index 760007e0a..902d9e7e2 100644 --- a/ANSDKAdMob.xcodeproj/project.pbxproj +++ b/ANSDKAdMob.xcodeproj/project.pbxproj @@ -33,6 +33,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 8A46BA3C1917E4EA00F4ADE1 /* ANBasicConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ANBasicConfig.h; path = sdk/internal/ANBasicConfig.h; sourceTree = SOURCE_ROOT; }; EC142D8018BBB4B9003989A0 /* GADAdSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADAdSize.h; sourceTree = ""; }; EC142D8118BBB4B9003989A0 /* GADCustomEventBanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADCustomEventBanner.h; sourceTree = ""; }; EC142D8218BBB4B9003989A0 /* GADCustomEventBannerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADCustomEventBannerDelegate.h; sourceTree = ""; }; @@ -91,6 +92,7 @@ EC2A47571845447900D29747 /* AdMob */ = { isa = PBXGroup; children = ( + 8A46BA3C1917E4EA00F4ADE1 /* ANBasicConfig.h */, EC2A47581845447900D29747 /* ANGADCustomBannerAd.h */, EC2A47591845447900D29747 /* ANGADCustomBannerAd.m */, EC2A475A1845447900D29747 /* ANGADCustomInterstitialAd.h */, diff --git a/ANSDKFull.xcodeproj/project.pbxproj b/ANSDKFull.xcodeproj/project.pbxproj index 390546d9c..90720e78c 100644 --- a/ANSDKFull.xcodeproj/project.pbxproj +++ b/ANSDKFull.xcodeproj/project.pbxproj @@ -7,8 +7,9 @@ objects = { /* Begin PBXBuildFile section */ + A8ED40DA1905BA3E009069FC /* MillennialMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A8ED40D91905BA3E009069FC /* MillennialMedia.framework */; }; + A8ED40DB1905BA50009069FC /* MillennialMedia.framework in Copy Files */ = {isa = PBXBuildFile; fileRef = A8ED40D91905BA3E009069FC /* MillennialMedia.framework */; }; EC3905FD1866948A0017959C /* ANTargetingParameters.h in Copy Files */ = {isa = PBXBuildFile; fileRef = EC3905FC1866947D0017959C /* ANTargetingParameters.h */; }; - EC3E5DB41843EB3E0070315E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EC3E5DB31843EB3E0070315E /* Foundation.framework */; }; EC3E5E0D1843ECF30070315E /* ANAdAdapterBannerAdMob.m in Sources */ = {isa = PBXBuildFile; fileRef = EC3E5DE31843ECF20070315E /* ANAdAdapterBannerAdMob.m */; }; EC3E5E0E1843ECF30070315E /* ANAdAdapterInterstitialAdMob.m in Sources */ = {isa = PBXBuildFile; fileRef = EC3E5DE51843ECF20070315E /* ANAdAdapterInterstitialAdMob.m */; }; EC3E5E0F1843ECF30070315E /* ANAdAdapterBanneriAd.m in Sources */ = {isa = PBXBuildFile; fileRef = EC3E5DE81843ECF20070315E /* ANAdAdapterBanneriAd.m */; }; @@ -17,7 +18,6 @@ EC3E5E141843ECF30070315E /* ANAdAdapterInterstitialMillennialMedia.m in Sources */ = {isa = PBXBuildFile; fileRef = EC3E5E0A1843ECF30070315E /* ANAdAdapterInterstitialMillennialMedia.m */; }; EC3E5E151843ECF30070315E /* ANAdAdapterMillennialMediaBase.m in Sources */ = {isa = PBXBuildFile; fileRef = EC3E5E0C1843ECF30070315E /* ANAdAdapterMillennialMediaBase.m */; }; EC3E5E1B1843ED4A0070315E /* libGoogleAdMobAds.a in Copy Files */ = {isa = PBXBuildFile; fileRef = EC3E5DFE1843ECF20070315E /* libGoogleAdMobAds.a */; }; - EC3E5E1C1843ED4A0070315E /* libMMSDK_5.1.1.a in Copy Files */ = {isa = PBXBuildFile; fileRef = EC3E5E011843ECF20070315E /* libMMSDK_5.1.1.a */; }; EC6AAED31885F52800CD2FDC /* ANAdAdapterBannerDFP.m in Sources */ = {isa = PBXBuildFile; fileRef = EC6AAECE1885F34900CD2FDC /* ANAdAdapterBannerDFP.m */; }; EC6AAED41885F52800CD2FDC /* ANAdAdapterInterstitialDFP.m in Sources */ = {isa = PBXBuildFile; fileRef = EC6AAED01885F34900CD2FDC /* ANAdAdapterInterstitialDFP.m */; }; EC7AB0881888814300C27B1E /* ANLogManager.h in Copy Files */ = {isa = PBXBuildFile; fileRef = EC7AB0871888813300C27B1E /* ANLogManager.h */; }; @@ -38,6 +38,7 @@ dstPath = "$(PRODUCT_NAME)"; dstSubfolderSpec = 16; files = ( + A8ED40DB1905BA50009069FC /* MillennialMedia.framework in Copy Files */, EC7AB0881888814300C27B1E /* ANLogManager.h in Copy Files */, EC3905FD1866948A0017959C /* ANTargetingParameters.h in Copy Files */, ECF23E7718452AEF00A94DE8 /* ANAdProtocol.h in Copy Files */, @@ -48,7 +49,6 @@ ECF23E7C18452AEF00A94DE8 /* ANLocation.h in Copy Files */, ECF23E7D18452AEF00A94DE8 /* ANSDKResources.bundle in Copy Files */, EC3E5E1B1843ED4A0070315E /* libGoogleAdMobAds.a in Copy Files */, - EC3E5E1C1843ED4A0070315E /* libMMSDK_5.1.1.a in Copy Files */, ); name = "Copy Files"; runOnlyForDeploymentPostprocessing = 0; @@ -56,6 +56,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 8A9C610C19195928008CF74C /* ANBasicConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ANBasicConfig.h; path = sdk/internal/ANBasicConfig.h; sourceTree = SOURCE_ROOT; }; + A816BFA41905AD3200346C79 /* MillennialMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MillennialMedia.framework; path = ../../../mm/MMSDK/MillennialMedia.framework; sourceTree = ""; }; + A8ED40D91905BA3E009069FC /* MillennialMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MillennialMedia.framework; path = mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework; sourceTree = ""; }; EC3905FC1866947D0017959C /* ANTargetingParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANTargetingParameters.h; sourceTree = ""; }; EC3E5DB01843EB3E0070315E /* libANSDKFull.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libANSDKFull.a; sourceTree = BUILT_PRODUCTS_DIR; }; EC3E5DB31843EB3E0070315E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; @@ -123,7 +126,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - EC3E5DB41843EB3E0070315E /* Foundation.framework in Frameworks */, + A8ED40DA1905BA3E009069FC /* MillennialMedia.framework in Frameworks */, ECF23E7618452AE100A94DE8 /* libANSDK.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -155,6 +158,8 @@ EC3E5DB21843EB3E0070315E /* Frameworks */ = { isa = PBXGroup; children = ( + A8ED40D91905BA3E009069FC /* MillennialMedia.framework */, + A816BFA41905AD3200346C79 /* MillennialMedia.framework */, EC3E5DEB1843ECF20070315E /* libs */, EC3E5DB31843EB3E0070315E /* Foundation.framework */, EC3E5DC11843EB3E0070315E /* XCTest.framework */, @@ -165,6 +170,7 @@ EC3E5DE11843ECF20070315E /* AdMob */ = { isa = PBXGroup; children = ( + 8A9C610C19195928008CF74C /* ANBasicConfig.h */, EC3E5DE21843ECF20070315E /* ANAdAdapterBannerAdMob.h */, EC3E5DE31843ECF20070315E /* ANAdAdapterBannerAdMob.m */, EC3E5DE41843ECF20070315E /* ANAdAdapterInterstitialAdMob.h */, @@ -334,7 +340,7 @@ EC3E5DA81843EB3E0070315E /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0510; ORGANIZATIONNAME = AppNexus; }; buildConfigurationList = EC3E5DAB1843EB3E0070315E /* Build configuration list for PBXProject "ANSDKFull" */; @@ -388,7 +394,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -426,7 +431,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -458,6 +462,10 @@ isa = XCBuildConfiguration; buildSettings = { DSTROOT = /tmp/ANSDKFull.dst; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/mediation/mediatedviews/libs/MMSDK", + ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ""; LIBRARY_SEARCH_PATHS = ( @@ -476,6 +484,10 @@ isa = XCBuildConfiguration; buildSettings = { DSTROOT = /tmp/ANSDKFull.dst; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/mediation/mediatedviews/libs/MMSDK", + ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ""; LIBRARY_SEARCH_PATHS = ( diff --git a/ANSDKFull.xcodeproj/xcshareddata/xcschemes/ANSDKFull.xcscheme b/ANSDKFull.xcodeproj/xcshareddata/xcschemes/ANSDKFull.xcscheme index f90d3a146..d381964b3 100644 --- a/ANSDKFull.xcodeproj/xcshareddata/xcschemes/ANSDKFull.xcscheme +++ b/ANSDKFull.xcodeproj/xcshareddata/xcschemes/ANSDKFull.xcscheme @@ -1,6 +1,6 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.135 + 1.16 CFBundleSignature ???? CFBundleURLTypes @@ -36,7 +36,7 @@ CFBundleVersion - 7 + 8 LSRequiresIPhoneOS UIMainStoryboardFile diff --git a/examples/AppNexusSDKApp/AppNexusSDKApp/Classes/Controllers/AppNexusSDKAppViewController.m b/examples/AppNexusSDKApp/AppNexusSDKApp/Classes/Controllers/AppNexusSDKAppViewController.m index a1fcf5c40..f584b9421 100644 --- a/examples/AppNexusSDKApp/AppNexusSDKApp/Classes/Controllers/AppNexusSDKAppViewController.m +++ b/examples/AppNexusSDKApp/AppNexusSDKApp/Classes/Controllers/AppNexusSDKAppViewController.m @@ -22,6 +22,7 @@ #import "LogViewController.h" // Notification Logging +#import "ANGlobal.h" #import "ANRequest+Make.h" #import "ANLog+Make.h" #import "ANResponse.h" @@ -82,6 +83,7 @@ - (void)viewDidLoad { - (void)setup { [ANLogManager setANLogLevel:ANLogLevelAll]; + ANSetNotificationsEnabled(YES); [self setInitialVCTabBarItem]; // Set Initially Selected Tab Bar Item [self registerForNotifications]; self.mainTabBar.delegate = self; // Set Parent VC as delegate of the Tab Bar diff --git a/mediation/mediatedviews/libs/MMSDK/MMAdView.h b/examples/AppNexusSDKApp/MillennialMedia.framework/Headers/MMAdView.h similarity index 73% rename from mediation/mediatedviews/libs/MMSDK/MMAdView.h rename to examples/AppNexusSDKApp/MillennialMedia.framework/Headers/MMAdView.h index 1edca259a..198d233a1 100644 --- a/mediation/mediatedviews/libs/MMSDK/MMAdView.h +++ b/examples/AppNexusSDKApp/MillennialMedia.framework/Headers/MMAdView.h @@ -2,17 +2,17 @@ // MMAdView.h // MMAdView // -// Copyright (c) 2013 Millennial Media Inc. All rights reserved. +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. // #import -#import "MMSDK.h" +#import @interface MMAdView : UIView // Set view controller to show overlay from -@property (nonatomic, assign) UIViewController *rootViewController; -@property (nonatomic) UIInterfaceOrientation overlayOrientation; +@property (nonatomic, strong) UIViewController *rootViewController; +@property (nonatomic) MMOverlayOrientationType orientationType; // Initializes the ad view and pass in the controller to present overlays from - (MMAdView *)initWithFrame:(CGRect)frame apid:(NSString *)apid rootViewController:(UIViewController *)viewController; diff --git a/mediation/mediatedviews/libs/MMSDK/MMInterstitial.h b/examples/AppNexusSDKApp/MillennialMedia.framework/Headers/MMInterstitial.h similarity index 79% rename from mediation/mediatedviews/libs/MMSDK/MMInterstitial.h rename to examples/AppNexusSDKApp/MillennialMedia.framework/Headers/MMInterstitial.h index 9e97fd02f..493f2e525 100644 --- a/mediation/mediatedviews/libs/MMSDK/MMInterstitial.h +++ b/examples/AppNexusSDKApp/MillennialMedia.framework/Headers/MMInterstitial.h @@ -2,11 +2,11 @@ // MMInterstitial.h // MMSDK // -// Copyright (c) 2013 Millennial Media Inc. All rights reserved. +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. // #import -#import "MMSDK.h" +#import @interface MMInterstitial : NSObject @@ -21,7 +21,7 @@ // Display an interstitial for a given APID. ViewController is required. Orientation is optional, use 0 if no preference. + (void)displayForApid:(NSString *)apid fromViewController:(UIViewController *)viewController - withOrientation:(UIInterfaceOrientation)overlayOrientation + withOrientation:(MMOverlayOrientationType)orientationType onCompletion:(MMCompletionBlock)callback; @end diff --git a/mediation/mediatedviews/libs/MMSDK/MMRequest.h b/examples/AppNexusSDKApp/MillennialMedia.framework/Headers/MMRequest.h similarity index 87% rename from mediation/mediatedviews/libs/MMSDK/MMRequest.h rename to examples/AppNexusSDKApp/MillennialMedia.framework/Headers/MMRequest.h index 29a2eb06c..459dcc25a 100644 --- a/mediation/mediatedviews/libs/MMSDK/MMRequest.h +++ b/examples/AppNexusSDKApp/MillennialMedia.framework/Headers/MMRequest.h @@ -2,12 +2,21 @@ // MMRequest.h // MMSDK // -// Copyright (c) 2013 Millennial Media Inc. All rights reserved. +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. // #import #import +enum { + MMOverlayOrientationTypeAll, + MMOverlayOrientationTypePortrait, + MMOverlayOrientationTypeLandscape +}; +typedef NSUInteger MMOverlayOrientationType; + +typedef void (^MMCompletionBlock) (BOOL success, NSError *error); + typedef enum { MMEducationOther, MMEducationNone, @@ -47,13 +56,6 @@ typedef enum { MMMaritalEngaged } MMMaritalStatus; -typedef enum { - MMSexualOrientationOther, - MMSexualOrientationGay, - MMSexualOrientationStraight, - MMSexualOrientationBisexual -} MMSexualOrientation; - @interface MMRequest : NSObject // Creates an MMRequest object @@ -74,7 +76,6 @@ typedef enum { @property (nonatomic, assign) MMGender gender; @property (nonatomic, assign) MMEthnicity ethnicity; @property (nonatomic, assign) MMMaritalStatus maritalStatus; -@property (nonatomic, assign) MMSexualOrientation orientation; @property (nonatomic, retain) NSNumber *age; @property (nonatomic, copy) NSString *zipCode; diff --git a/mediation/mediatedviews/libs/MMSDK/MMSDK.h b/examples/AppNexusSDKApp/MillennialMedia.framework/Headers/MMSDK.h similarity index 90% rename from mediation/mediatedviews/libs/MMSDK/MMSDK.h rename to examples/AppNexusSDKApp/MillennialMedia.framework/Headers/MMSDK.h index 1f84adec0..d2f787801 100644 --- a/mediation/mediatedviews/libs/MMSDK/MMSDK.h +++ b/examples/AppNexusSDKApp/MillennialMedia.framework/Headers/MMSDK.h @@ -2,11 +2,11 @@ // MMSDK.h // MMSDK // -// Copyright (c) 2013 Millennial Media Inc. All rights reserved. +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. // #import -#import "MMRequest.h" +#import // NSNotification keys extern NSString * const MillennialMediaAdWillTerminateApplication; @@ -42,8 +42,6 @@ typedef enum LogLevel { MMLOG_LEVEL_FATAL = 1 << 3 } MMLogLevel; -typedef void (^MMCompletionBlock) (BOOL success, NSError *error); - @interface MMSDK : NSObject + (void)initialize; diff --git a/examples/AppNexusSDKApp/MillennialMedia.framework/MillennialMedia b/examples/AppNexusSDKApp/MillennialMedia.framework/MillennialMedia new file mode 100644 index 000000000..7cb98d0e1 Binary files /dev/null and b/examples/AppNexusSDKApp/MillennialMedia.framework/MillennialMedia differ diff --git a/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/A/Headers/MMAdView.h b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/A/Headers/MMAdView.h new file mode 100644 index 000000000..198d233a1 --- /dev/null +++ b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/A/Headers/MMAdView.h @@ -0,0 +1,26 @@ +// +// MMAdView.h +// MMAdView +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +@interface MMAdView : UIView + +// Set view controller to show overlay from +@property (nonatomic, strong) UIViewController *rootViewController; +@property (nonatomic) MMOverlayOrientationType orientationType; + +// Initializes the ad view and pass in the controller to present overlays from +- (MMAdView *)initWithFrame:(CGRect)frame apid:(NSString *)apid rootViewController:(UIViewController *)viewController; + +// Request a new ad with a generic MMRequest +- (void)getAd:(MMCompletionBlock)callback; + +// Request a new ad with a custom MMRequest object (pass in location, keywords, & demographic information) +- (void)getAdWithRequest:(MMRequest *)request onCompletion:(MMCompletionBlock)callback; + +@end \ No newline at end of file diff --git a/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/A/Headers/MMInterstitial.h b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/A/Headers/MMInterstitial.h new file mode 100644 index 000000000..493f2e525 --- /dev/null +++ b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/A/Headers/MMInterstitial.h @@ -0,0 +1,27 @@ +// +// MMInterstitial.h +// MMSDK +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +@interface MMInterstitial : NSObject + +// Fetch an interstitial for a given APID ++ (void)fetchWithRequest:(MMRequest *)request + apid:(NSString *)apid + onCompletion:(MMCompletionBlock)callback; + +// Check if an ad is available for a given APID ++ (BOOL)isAdAvailableForApid:(NSString *)apid; + +// Display an interstitial for a given APID. ViewController is required. Orientation is optional, use 0 if no preference. ++ (void)displayForApid:(NSString *)apid + fromViewController:(UIViewController *)viewController + withOrientation:(MMOverlayOrientationType)orientationType + onCompletion:(MMCompletionBlock)callback; + +@end diff --git a/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/A/Headers/MMRequest.h b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/A/Headers/MMRequest.h new file mode 100644 index 000000000..459dcc25a --- /dev/null +++ b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/A/Headers/MMRequest.h @@ -0,0 +1,98 @@ +// +// MMRequest.h +// MMSDK +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +enum { + MMOverlayOrientationTypeAll, + MMOverlayOrientationTypePortrait, + MMOverlayOrientationTypeLandscape +}; +typedef NSUInteger MMOverlayOrientationType; + +typedef void (^MMCompletionBlock) (BOOL success, NSError *error); + +typedef enum { + MMEducationOther, + MMEducationNone, + MMEducationHighSchool, + MMEducationInCollege, + MMEducationSomeCollege, + MMEducationAssociates, + MMEducationBachelors, + MMEducationMasters, + MMEducationDoctorate +} MMEducation; + +typedef enum { + MMGenderOther, + MMGenderMale, + MMGenderFemale +} MMGender; + +typedef enum { + MMEthnicityMiddleEastern, + MMEthnicityAsian, + MMEthnicityBlack, + MMEthnicityHispanic, + MMEthnicityIndian, + MMEthnicityNativeAmerican, + MMEthnicityPacificIslander, + MMEthnicityWhite, + MMEthnicityOther +} MMEthnicity; + +typedef enum { + MMMaritalOther, + MMMaritalSingle, + MMMaritalRelationship, + MMMaritalMarried, + MMMaritalDivorced, + MMMaritalEngaged +} MMMaritalStatus; + +@interface MMRequest : NSObject + +// Creates an MMRequest object ++ (MMRequest *)request; + +#pragma mark - Location Information + +// Creates an MMRequest object with location ++ (MMRequest *)requestWithLocation:(CLLocation *)location; + +// Set location for the ad request +@property (nonatomic, retain) CLLocation *location; + +#pragma mark - Demographic Information + +// Set demographic information for the ad request +@property (nonatomic, assign) MMEducation education; +@property (nonatomic, assign) MMGender gender; +@property (nonatomic, assign) MMEthnicity ethnicity; +@property (nonatomic, assign) MMMaritalStatus maritalStatus; +@property (nonatomic, retain) NSNumber *age; +@property (nonatomic, copy) NSString *zipCode; + +#pragma mark - Contextual Information + +// Set an array of keywords (must be NSString values) +@property (nonatomic, retain) NSMutableArray *keywords; + +// Add keywords one at a time to the array +- (void)addKeyword:(NSString *)keyword; + +#pragma mark - Additional Information + +// Set additional parameters for the ad request. Value must be NSNumber or NSString. +- (void)setValue:(id)value forKey:(NSString *)key; + +#pragma mark - Request parameters (read-only) +@property (nonatomic, retain, readonly) NSMutableDictionary *dataParameters; + +@end diff --git a/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/A/Headers/MMSDK.h b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/A/Headers/MMSDK.h new file mode 100644 index 000000000..d2f787801 --- /dev/null +++ b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/A/Headers/MMSDK.h @@ -0,0 +1,54 @@ +// +// MMSDK.h +// MMSDK +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +// NSNotification keys +extern NSString * const MillennialMediaAdWillTerminateApplication; +extern NSString * const MillennialMediaAdWasTapped; +extern NSString * const MillennialMediaAdModalWillAppear; +extern NSString * const MillennialMediaAdModalDidAppear; +extern NSString * const MillennialMediaAdModalWillDismiss; +extern NSString * const MillennialMediaAdModalDidDismiss; +extern NSString * const MillennialMediaKeyboardWillObscureAd; +extern NSString * const MillennialMediaKeyboardWillHide; + +// NSNotification userInfo keys +extern NSString * const MillennialMediaAdObjectKey; +extern NSString * const MillennialMediaAPIDKey; +extern NSString * const MillennialMediaAdTypeKey; + +// Millennial Media Ad Type keys +extern NSString * const MillennialMediaAdTypeBanner; +extern NSString * const MillennialMediaAdTypeInterstitial; + +typedef enum ErrorCode { + MMAdUnknownError = 0, + MMAdServerError = -500, + MMAdUnavailable = -503, + MMAdDisabled = -9999999 +} MMErrorCode; + +typedef enum LogLevel { + MMLOG_LEVEL_OFF = 0, + MMLOG_LEVEL_INFO = 1 << 0, + MMLOG_LEVEL_DEBUG = 1 << 1, + MMLOG_LEVEL_ERROR = 1 << 2, + MMLOG_LEVEL_FATAL = 1 << 3 +} MMLogLevel; + +@interface MMSDK : NSObject + ++ (void)initialize; ++ (NSString *)version; ++ (void)trackConversionWithGoalId:(NSString *)goalId; ++ (void)trackConversionWithGoalId:(NSString *)goalId requestData:(MMRequest *)request; ++ (void)setLogLevel:(MMLogLevel)level; ++ (void)trackEventWithId:(NSString *)eventId; + +@end diff --git a/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/A/MillennialMedia b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/A/MillennialMedia new file mode 100644 index 000000000..7cb98d0e1 Binary files /dev/null and b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/A/MillennialMedia differ diff --git a/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/Current/Headers/MMAdView.h b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/Current/Headers/MMAdView.h new file mode 100644 index 000000000..198d233a1 --- /dev/null +++ b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/Current/Headers/MMAdView.h @@ -0,0 +1,26 @@ +// +// MMAdView.h +// MMAdView +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +@interface MMAdView : UIView + +// Set view controller to show overlay from +@property (nonatomic, strong) UIViewController *rootViewController; +@property (nonatomic) MMOverlayOrientationType orientationType; + +// Initializes the ad view and pass in the controller to present overlays from +- (MMAdView *)initWithFrame:(CGRect)frame apid:(NSString *)apid rootViewController:(UIViewController *)viewController; + +// Request a new ad with a generic MMRequest +- (void)getAd:(MMCompletionBlock)callback; + +// Request a new ad with a custom MMRequest object (pass in location, keywords, & demographic information) +- (void)getAdWithRequest:(MMRequest *)request onCompletion:(MMCompletionBlock)callback; + +@end \ No newline at end of file diff --git a/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/Current/Headers/MMInterstitial.h b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/Current/Headers/MMInterstitial.h new file mode 100644 index 000000000..493f2e525 --- /dev/null +++ b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/Current/Headers/MMInterstitial.h @@ -0,0 +1,27 @@ +// +// MMInterstitial.h +// MMSDK +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +@interface MMInterstitial : NSObject + +// Fetch an interstitial for a given APID ++ (void)fetchWithRequest:(MMRequest *)request + apid:(NSString *)apid + onCompletion:(MMCompletionBlock)callback; + +// Check if an ad is available for a given APID ++ (BOOL)isAdAvailableForApid:(NSString *)apid; + +// Display an interstitial for a given APID. ViewController is required. Orientation is optional, use 0 if no preference. ++ (void)displayForApid:(NSString *)apid + fromViewController:(UIViewController *)viewController + withOrientation:(MMOverlayOrientationType)orientationType + onCompletion:(MMCompletionBlock)callback; + +@end diff --git a/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/Current/Headers/MMRequest.h b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/Current/Headers/MMRequest.h new file mode 100644 index 000000000..459dcc25a --- /dev/null +++ b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/Current/Headers/MMRequest.h @@ -0,0 +1,98 @@ +// +// MMRequest.h +// MMSDK +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +enum { + MMOverlayOrientationTypeAll, + MMOverlayOrientationTypePortrait, + MMOverlayOrientationTypeLandscape +}; +typedef NSUInteger MMOverlayOrientationType; + +typedef void (^MMCompletionBlock) (BOOL success, NSError *error); + +typedef enum { + MMEducationOther, + MMEducationNone, + MMEducationHighSchool, + MMEducationInCollege, + MMEducationSomeCollege, + MMEducationAssociates, + MMEducationBachelors, + MMEducationMasters, + MMEducationDoctorate +} MMEducation; + +typedef enum { + MMGenderOther, + MMGenderMale, + MMGenderFemale +} MMGender; + +typedef enum { + MMEthnicityMiddleEastern, + MMEthnicityAsian, + MMEthnicityBlack, + MMEthnicityHispanic, + MMEthnicityIndian, + MMEthnicityNativeAmerican, + MMEthnicityPacificIslander, + MMEthnicityWhite, + MMEthnicityOther +} MMEthnicity; + +typedef enum { + MMMaritalOther, + MMMaritalSingle, + MMMaritalRelationship, + MMMaritalMarried, + MMMaritalDivorced, + MMMaritalEngaged +} MMMaritalStatus; + +@interface MMRequest : NSObject + +// Creates an MMRequest object ++ (MMRequest *)request; + +#pragma mark - Location Information + +// Creates an MMRequest object with location ++ (MMRequest *)requestWithLocation:(CLLocation *)location; + +// Set location for the ad request +@property (nonatomic, retain) CLLocation *location; + +#pragma mark - Demographic Information + +// Set demographic information for the ad request +@property (nonatomic, assign) MMEducation education; +@property (nonatomic, assign) MMGender gender; +@property (nonatomic, assign) MMEthnicity ethnicity; +@property (nonatomic, assign) MMMaritalStatus maritalStatus; +@property (nonatomic, retain) NSNumber *age; +@property (nonatomic, copy) NSString *zipCode; + +#pragma mark - Contextual Information + +// Set an array of keywords (must be NSString values) +@property (nonatomic, retain) NSMutableArray *keywords; + +// Add keywords one at a time to the array +- (void)addKeyword:(NSString *)keyword; + +#pragma mark - Additional Information + +// Set additional parameters for the ad request. Value must be NSNumber or NSString. +- (void)setValue:(id)value forKey:(NSString *)key; + +#pragma mark - Request parameters (read-only) +@property (nonatomic, retain, readonly) NSMutableDictionary *dataParameters; + +@end diff --git a/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/Current/Headers/MMSDK.h b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/Current/Headers/MMSDK.h new file mode 100644 index 000000000..d2f787801 --- /dev/null +++ b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/Current/Headers/MMSDK.h @@ -0,0 +1,54 @@ +// +// MMSDK.h +// MMSDK +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +// NSNotification keys +extern NSString * const MillennialMediaAdWillTerminateApplication; +extern NSString * const MillennialMediaAdWasTapped; +extern NSString * const MillennialMediaAdModalWillAppear; +extern NSString * const MillennialMediaAdModalDidAppear; +extern NSString * const MillennialMediaAdModalWillDismiss; +extern NSString * const MillennialMediaAdModalDidDismiss; +extern NSString * const MillennialMediaKeyboardWillObscureAd; +extern NSString * const MillennialMediaKeyboardWillHide; + +// NSNotification userInfo keys +extern NSString * const MillennialMediaAdObjectKey; +extern NSString * const MillennialMediaAPIDKey; +extern NSString * const MillennialMediaAdTypeKey; + +// Millennial Media Ad Type keys +extern NSString * const MillennialMediaAdTypeBanner; +extern NSString * const MillennialMediaAdTypeInterstitial; + +typedef enum ErrorCode { + MMAdUnknownError = 0, + MMAdServerError = -500, + MMAdUnavailable = -503, + MMAdDisabled = -9999999 +} MMErrorCode; + +typedef enum LogLevel { + MMLOG_LEVEL_OFF = 0, + MMLOG_LEVEL_INFO = 1 << 0, + MMLOG_LEVEL_DEBUG = 1 << 1, + MMLOG_LEVEL_ERROR = 1 << 2, + MMLOG_LEVEL_FATAL = 1 << 3 +} MMLogLevel; + +@interface MMSDK : NSObject + ++ (void)initialize; ++ (NSString *)version; ++ (void)trackConversionWithGoalId:(NSString *)goalId; ++ (void)trackConversionWithGoalId:(NSString *)goalId requestData:(MMRequest *)request; ++ (void)setLogLevel:(MMLogLevel)level; ++ (void)trackEventWithId:(NSString *)eventId; + +@end diff --git a/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/Current/MillennialMedia b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/Current/MillennialMedia new file mode 100644 index 000000000..7cb98d0e1 Binary files /dev/null and b/examples/AppNexusSDKApp/MillennialMedia.framework/Versions/Current/MillennialMedia differ diff --git a/mediation/mediatedviews/ANMediatedViewsLibrary/ANMediatedViewsLibrary.xcodeproj/project.pbxproj b/mediation/mediatedviews/ANMediatedViewsLibrary/ANMediatedViewsLibrary.xcodeproj/project.pbxproj index 6f2eacf3c..7c74876e0 100644 --- a/mediation/mediatedviews/ANMediatedViewsLibrary/ANMediatedViewsLibrary.xcodeproj/project.pbxproj +++ b/mediation/mediatedviews/ANMediatedViewsLibrary/ANMediatedViewsLibrary.xcodeproj/project.pbxproj @@ -7,58 +7,64 @@ objects = { /* Begin PBXBuildFile section */ + A8ED40DE1905BDE5009069FC /* MillennialMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A8ED40DD1905BDE5009069FC /* MillennialMedia.framework */; }; + A8ED40E01905CB8E009069FC /* MillennialMedia.framework in Copy Files */ = {isa = PBXBuildFile; fileRef = A8ED40DF1905CB8E009069FC /* MillennialMedia.framework */; }; ECAFB01A1864BF66007F1973 /* ANAdAdapterBannerDFP.m in Sources */ = {isa = PBXBuildFile; fileRef = ECAFB0191864BF66007F1973 /* ANAdAdapterBannerDFP.m */; }; ECAFB0271864D157007F1973 /* ANAdAdapterInterstitialDFP.m in Sources */ = {isa = PBXBuildFile; fileRef = ECAFB0261864D157007F1973 /* ANAdAdapterInterstitialDFP.m */; }; ECB1237418219C9D00CB4BE8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ECB1237318219C9D00CB4BE8 /* Foundation.framework */; }; ECB123D118219D4F00CB4BE8 /* libGoogleAdMobAds.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ECB123C918219D4F00CB4BE8 /* libGoogleAdMobAds.a */; }; - ECB123D218219D4F00CB4BE8 /* libMMSDK_5.1.1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ECB123CC18219D4F00CB4BE8 /* libMMSDK_5.1.1.a */; }; ECB1245918219ECE00CB4BE8 /* ANAdAdapterBannerMillennialMedia.m in Sources */ = {isa = PBXBuildFile; fileRef = ECB1244C18219ECE00CB4BE8 /* ANAdAdapterBannerMillennialMedia.m */; }; ECB1245A18219ECE00CB4BE8 /* ANAdAdapterInterstitialMillennialMedia.m in Sources */ = {isa = PBXBuildFile; fileRef = ECB1244E18219ECE00CB4BE8 /* ANAdAdapterInterstitialMillennialMedia.m */; }; ECB1245B18219ECE00CB4BE8 /* ANAdAdapterBanneriAd.m in Sources */ = {isa = PBXBuildFile; fileRef = ECB1245118219ECE00CB4BE8 /* ANAdAdapterBanneriAd.m */; }; ECB1245C18219ECE00CB4BE8 /* ANAdAdapterInterstitialiAd.m in Sources */ = {isa = PBXBuildFile; fileRef = ECB1245318219ECE00CB4BE8 /* ANAdAdapterInterstitialiAd.m */; }; ECB1245D18219ECE00CB4BE8 /* ANAdAdapterBannerAdMob.m in Sources */ = {isa = PBXBuildFile; fileRef = ECB1245618219ECE00CB4BE8 /* ANAdAdapterBannerAdMob.m */; }; ECB1245E18219ECE00CB4BE8 /* ANAdAdapterInterstitialAdMob.m in Sources */ = {isa = PBXBuildFile; fileRef = ECB1245818219ECE00CB4BE8 /* ANAdAdapterInterstitialAdMob.m */; }; - ECB1245F18219ED600CB4BE8 /* ANAdAdapterBannerMillennialMedia.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = ECB1244B18219ECE00CB4BE8 /* ANAdAdapterBannerMillennialMedia.h */; }; - ECB1246018219ED600CB4BE8 /* ANAdAdapterBannerMillennialMedia.m in CopyFiles */ = {isa = PBXBuildFile; fileRef = ECB1244C18219ECE00CB4BE8 /* ANAdAdapterBannerMillennialMedia.m */; }; - ECB1246118219ED600CB4BE8 /* ANAdAdapterInterstitialMillennialMedia.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = ECB1244D18219ECE00CB4BE8 /* ANAdAdapterInterstitialMillennialMedia.h */; }; - ECB1246218219ED600CB4BE8 /* ANAdAdapterInterstitialMillennialMedia.m in CopyFiles */ = {isa = PBXBuildFile; fileRef = ECB1244E18219ECE00CB4BE8 /* ANAdAdapterInterstitialMillennialMedia.m */; }; - ECB1246318219ED600CB4BE8 /* ANAdAdapterBanneriAd.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = ECB1245018219ECE00CB4BE8 /* ANAdAdapterBanneriAd.h */; }; - ECB1246418219ED600CB4BE8 /* ANAdAdapterBanneriAd.m in CopyFiles */ = {isa = PBXBuildFile; fileRef = ECB1245118219ECE00CB4BE8 /* ANAdAdapterBanneriAd.m */; }; - ECB1246518219ED600CB4BE8 /* ANAdAdapterInterstitialiAd.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = ECB1245218219ECE00CB4BE8 /* ANAdAdapterInterstitialiAd.h */; }; - ECB1246618219ED600CB4BE8 /* ANAdAdapterInterstitialiAd.m in CopyFiles */ = {isa = PBXBuildFile; fileRef = ECB1245318219ECE00CB4BE8 /* ANAdAdapterInterstitialiAd.m */; }; - ECB1246718219ED600CB4BE8 /* ANAdAdapterBannerAdMob.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = ECB1245518219ECE00CB4BE8 /* ANAdAdapterBannerAdMob.h */; }; - ECB1246818219ED600CB4BE8 /* ANAdAdapterBannerAdMob.m in CopyFiles */ = {isa = PBXBuildFile; fileRef = ECB1245618219ECE00CB4BE8 /* ANAdAdapterBannerAdMob.m */; }; - ECB1246918219ED600CB4BE8 /* ANAdAdapterInterstitialAdMob.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = ECB1245718219ECE00CB4BE8 /* ANAdAdapterInterstitialAdMob.h */; }; - ECB1246A18219ED600CB4BE8 /* ANAdAdapterInterstitialAdMob.m in CopyFiles */ = {isa = PBXBuildFile; fileRef = ECB1245818219ECE00CB4BE8 /* ANAdAdapterInterstitialAdMob.m */; }; + ECB1245F18219ED600CB4BE8 /* ANAdAdapterBannerMillennialMedia.h in Copy Files */ = {isa = PBXBuildFile; fileRef = ECB1244B18219ECE00CB4BE8 /* ANAdAdapterBannerMillennialMedia.h */; }; + ECB1246018219ED600CB4BE8 /* ANAdAdapterBannerMillennialMedia.m in Copy Files */ = {isa = PBXBuildFile; fileRef = ECB1244C18219ECE00CB4BE8 /* ANAdAdapterBannerMillennialMedia.m */; }; + ECB1246118219ED600CB4BE8 /* ANAdAdapterInterstitialMillennialMedia.h in Copy Files */ = {isa = PBXBuildFile; fileRef = ECB1244D18219ECE00CB4BE8 /* ANAdAdapterInterstitialMillennialMedia.h */; }; + ECB1246218219ED600CB4BE8 /* ANAdAdapterInterstitialMillennialMedia.m in Copy Files */ = {isa = PBXBuildFile; fileRef = ECB1244E18219ECE00CB4BE8 /* ANAdAdapterInterstitialMillennialMedia.m */; }; + ECB1246318219ED600CB4BE8 /* ANAdAdapterBanneriAd.h in Copy Files */ = {isa = PBXBuildFile; fileRef = ECB1245018219ECE00CB4BE8 /* ANAdAdapterBanneriAd.h */; }; + ECB1246418219ED600CB4BE8 /* ANAdAdapterBanneriAd.m in Copy Files */ = {isa = PBXBuildFile; fileRef = ECB1245118219ECE00CB4BE8 /* ANAdAdapterBanneriAd.m */; }; + ECB1246518219ED600CB4BE8 /* ANAdAdapterInterstitialiAd.h in Copy Files */ = {isa = PBXBuildFile; fileRef = ECB1245218219ECE00CB4BE8 /* ANAdAdapterInterstitialiAd.h */; }; + ECB1246618219ED600CB4BE8 /* ANAdAdapterInterstitialiAd.m in Copy Files */ = {isa = PBXBuildFile; fileRef = ECB1245318219ECE00CB4BE8 /* ANAdAdapterInterstitialiAd.m */; }; + ECB1246718219ED600CB4BE8 /* ANAdAdapterBannerAdMob.h in Copy Files */ = {isa = PBXBuildFile; fileRef = ECB1245518219ECE00CB4BE8 /* ANAdAdapterBannerAdMob.h */; }; + ECB1246818219ED600CB4BE8 /* ANAdAdapterBannerAdMob.m in Copy Files */ = {isa = PBXBuildFile; fileRef = ECB1245618219ECE00CB4BE8 /* ANAdAdapterBannerAdMob.m */; }; + ECB1246918219ED600CB4BE8 /* ANAdAdapterInterstitialAdMob.h in Copy Files */ = {isa = PBXBuildFile; fileRef = ECB1245718219ECE00CB4BE8 /* ANAdAdapterInterstitialAdMob.h */; }; + ECB1246A18219ED600CB4BE8 /* ANAdAdapterInterstitialAdMob.m in Copy Files */ = {isa = PBXBuildFile; fileRef = ECB1245818219ECE00CB4BE8 /* ANAdAdapterInterstitialAdMob.m */; }; ECCF18F51835792300B17EB4 /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ECCF18F41835792300B17EB4 /* iAd.framework */; }; ECFCC0DB1831890F00797F72 /* ANAdAdapterMillennialMediaBase.m in Sources */ = {isa = PBXBuildFile; fileRef = ECFCC0DA1831890F00797F72 /* ANAdAdapterMillennialMediaBase.m */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - ECB1236E18219C9D00CB4BE8 /* CopyFiles */ = { + ECB1236E18219C9D00CB4BE8 /* Copy Files */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = "include/$(PRODUCT_NAME)"; dstSubfolderSpec = 16; files = ( - ECB1245F18219ED600CB4BE8 /* ANAdAdapterBannerMillennialMedia.h in CopyFiles */, - ECB1246018219ED600CB4BE8 /* ANAdAdapterBannerMillennialMedia.m in CopyFiles */, - ECB1246118219ED600CB4BE8 /* ANAdAdapterInterstitialMillennialMedia.h in CopyFiles */, - ECB1246218219ED600CB4BE8 /* ANAdAdapterInterstitialMillennialMedia.m in CopyFiles */, - ECB1246318219ED600CB4BE8 /* ANAdAdapterBanneriAd.h in CopyFiles */, - ECB1246418219ED600CB4BE8 /* ANAdAdapterBanneriAd.m in CopyFiles */, - ECB1246518219ED600CB4BE8 /* ANAdAdapterInterstitialiAd.h in CopyFiles */, - ECB1246618219ED600CB4BE8 /* ANAdAdapterInterstitialiAd.m in CopyFiles */, - ECB1246718219ED600CB4BE8 /* ANAdAdapterBannerAdMob.h in CopyFiles */, - ECB1246818219ED600CB4BE8 /* ANAdAdapterBannerAdMob.m in CopyFiles */, - ECB1246918219ED600CB4BE8 /* ANAdAdapterInterstitialAdMob.h in CopyFiles */, - ECB1246A18219ED600CB4BE8 /* ANAdAdapterInterstitialAdMob.m in CopyFiles */, + A8ED40E01905CB8E009069FC /* MillennialMedia.framework in Copy Files */, + ECB1245F18219ED600CB4BE8 /* ANAdAdapterBannerMillennialMedia.h in Copy Files */, + ECB1246018219ED600CB4BE8 /* ANAdAdapterBannerMillennialMedia.m in Copy Files */, + ECB1246118219ED600CB4BE8 /* ANAdAdapterInterstitialMillennialMedia.h in Copy Files */, + ECB1246218219ED600CB4BE8 /* ANAdAdapterInterstitialMillennialMedia.m in Copy Files */, + ECB1246318219ED600CB4BE8 /* ANAdAdapterBanneriAd.h in Copy Files */, + ECB1246418219ED600CB4BE8 /* ANAdAdapterBanneriAd.m in Copy Files */, + ECB1246518219ED600CB4BE8 /* ANAdAdapterInterstitialiAd.h in Copy Files */, + ECB1246618219ED600CB4BE8 /* ANAdAdapterInterstitialiAd.m in Copy Files */, + ECB1246718219ED600CB4BE8 /* ANAdAdapterBannerAdMob.h in Copy Files */, + ECB1246818219ED600CB4BE8 /* ANAdAdapterBannerAdMob.m in Copy Files */, + ECB1246918219ED600CB4BE8 /* ANAdAdapterInterstitialAdMob.h in Copy Files */, + ECB1246A18219ED600CB4BE8 /* ANAdAdapterInterstitialAdMob.m in Copy Files */, ); + name = "Copy Files"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 8A7ADEDC191969E80054FB8F /* ANBasicConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ANBasicConfig.h; path = ../../../sdk/internal/ANBasicConfig.h; sourceTree = ""; }; + A8ED40DD1905BDE5009069FC /* MillennialMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MillennialMedia.framework; path = ../libs/MMSDK/MillennialMedia.framework; sourceTree = ""; }; + A8ED40DF1905CB8E009069FC /* MillennialMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MillennialMedia.framework; path = ../libs/MMSDK/MillennialMedia.framework; sourceTree = ""; }; EC8477B11844166900A8BC80 /* ANCustomAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ANCustomAdapter.h; path = ../../../sdk/ANCustomAdapter.h; sourceTree = ""; }; ECAFB0181864BF66007F1973 /* ANAdAdapterBannerDFP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdAdapterBannerDFP.h; sourceTree = ""; }; ECAFB0191864BF66007F1973 /* ANAdAdapterBannerDFP.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANAdAdapterBannerDFP.m; sourceTree = ""; }; @@ -120,10 +126,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A8ED40DE1905BDE5009069FC /* MillennialMedia.framework in Frameworks */, ECCF18F51835792300B17EB4 /* iAd.framework in Frameworks */, ECB1237418219C9D00CB4BE8 /* Foundation.framework in Frameworks */, ECB123D118219D4F00CB4BE8 /* libGoogleAdMobAds.a in Frameworks */, - ECB123D218219D4F00CB4BE8 /* libMMSDK_5.1.1.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -159,9 +165,11 @@ ECB1236718219C9D00CB4BE8 = { isa = PBXGroup; children = ( + A8ED40DF1905CB8E009069FC /* MillennialMedia.framework */, EC8477B11844166900A8BC80 /* ANCustomAdapter.h */, ECB1253A1821A35D00CB4BE8 /* ANGlobal.h */, ECB1253C1821A35D00CB4BE8 /* ANLogging.h */, + 8A7ADEDC191969E80054FB8F /* ANBasicConfig.h */, ECB1237218219C9D00CB4BE8 /* Frameworks */, ECB1237118219C9D00CB4BE8 /* Products */, ); @@ -178,6 +186,7 @@ ECB1237218219C9D00CB4BE8 /* Frameworks */ = { isa = PBXGroup; children = ( + A8ED40DD1905BDE5009069FC /* MillennialMedia.framework */, ECAFB0171864BF47007F1973 /* DFP */, ECCF18F41835792300B17EB4 /* iAd.framework */, ECB1244A18219ECD00CB4BE8 /* MillennialMedia */, @@ -300,7 +309,7 @@ buildPhases = ( ECB1236C18219C9D00CB4BE8 /* Sources */, ECB1236D18219C9D00CB4BE8 /* Frameworks */, - ECB1236E18219C9D00CB4BE8 /* CopyFiles */, + ECB1236E18219C9D00CB4BE8 /* Copy Files */, ); buildRules = ( ); @@ -430,11 +439,14 @@ isa = XCBuildConfiguration; buildSettings = { DSTROOT = /tmp/ANMediatedViewsLibrary.dst; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/../libs/MMSDK", + ); GCC_PRECOMPILE_PREFIX_HEADER = YES; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/../libs/AdMob", - "$(PROJECT_DIR)/../libs/MMSDK", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -446,11 +458,14 @@ isa = XCBuildConfiguration; buildSettings = { DSTROOT = /tmp/ANMediatedViewsLibrary.dst; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/../libs/MMSDK", + ); GCC_PRECOMPILE_PREFIX_HEADER = YES; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/../libs/AdMob", - "$(PROJECT_DIR)/../libs/MMSDK", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/mediation/mediatedviews/AdMob/ANAdAdapterBannerAdMob.h b/mediation/mediatedviews/AdMob/ANAdAdapterBannerAdMob.h index 1fdfb07d0..a95a4d445 100644 --- a/mediation/mediatedviews/AdMob/ANAdAdapterBannerAdMob.h +++ b/mediation/mediatedviews/AdMob/ANAdAdapterBannerAdMob.h @@ -13,10 +13,10 @@ limitations under the License. */ - -#import "ANCustomAdapter.h" +#import "ANBasicConfig.h" +#import ANCUSTOMADAPTERHEADER #import "GADBannerView.h" -@interface ANAdAdapterBannerAdMob : NSObject +@interface ANAdAdapterBannerAdMob : NSObject @end diff --git a/mediation/mediatedviews/AdMob/ANAdAdapterBannerAdMob.m b/mediation/mediatedviews/AdMob/ANAdAdapterBannerAdMob.m index 1e0735fff..704503690 100644 --- a/mediation/mediatedviews/AdMob/ANAdAdapterBannerAdMob.m +++ b/mediation/mediatedviews/AdMob/ANAdAdapterBannerAdMob.m @@ -15,6 +15,8 @@ #import "ANAdAdapterBannerAdMob.h" +#import "GADAdMobExtras.h" + @interface ANAdAdapterBannerAdMob () @property (nonatomic, readwrite, strong) GADBannerView *bannerView; @end @@ -43,7 +45,7 @@ - (void)requestBannerAdWithSize:(CGSize)size rootViewController:(UIViewController *)rootViewController serverParameter:(NSString *)parameterString adUnitId:(NSString *)idString - targetingParameters:(ANTargetingParameters *)targetingParameters + targetingParameters:(ANTARGETINGPARAMETERS *)targetingParameters { NSLog(@"Requesting AdMob banner with size: %fx%f", size.width, size.height); GADAdSize gadAdSize; @@ -71,10 +73,10 @@ - (void)requestBannerAdWithSize:(CGSize)size [self.bannerView loadRequest:[self createRequestFromTargetingParameters:targetingParameters]]; } -- (GADRequest *)createRequestFromTargetingParameters:(ANTargetingParameters *)targetingParameters { +- (GADRequest *)createRequestFromTargetingParameters:(ANTARGETINGPARAMETERS *)targetingParameters { GADRequest *request = [GADRequest request]; - ANGender gender = targetingParameters.gender; + ANGENDER gender = targetingParameters.gender; switch (gender) { case MALE: request.gender = kGADGenderMale; @@ -88,14 +90,16 @@ - (GADRequest *)createRequestFromTargetingParameters:(ANTargetingParameters *)ta break; } - ANLocation *location = targetingParameters.location; + ANLOCATION *location = targetingParameters.location; if (location) { [request setLocationWithLatitude:location.latitude longitude:location.longitude accuracy:location.horizontalAccuracy]; } - - request.additionalParameters = targetingParameters.customKeywords; + + GADAdMobExtras *extras = [GADAdMobExtras new]; + extras.additionalParameters = targetingParameters.customKeywords; + [request registerAdNetworkExtras:extras]; return request; } @@ -171,7 +175,7 @@ - (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestErro break; } - [self.delegate didFailToLoadAd:code]; + [self.delegate didFailToLoadAd:(ANADRESPONSECODE)code]; } - (void)adViewWillPresentScreen:(GADBannerView *)adView { diff --git a/mediation/mediatedviews/AdMob/ANAdAdapterInterstitialAdMob.h b/mediation/mediatedviews/AdMob/ANAdAdapterInterstitialAdMob.h index 273d9832d..f24831c16 100644 --- a/mediation/mediatedviews/AdMob/ANAdAdapterInterstitialAdMob.h +++ b/mediation/mediatedviews/AdMob/ANAdAdapterInterstitialAdMob.h @@ -13,9 +13,10 @@ limitations under the License. */ -#import "ANCustomAdapter.h" +#import "ANBasicConfig.h" +#import ANCUSTOMADAPTERHEADER #import "GADInterstitial.h" -@interface ANAdAdapterInterstitialAdMob : NSObject +@interface ANAdAdapterInterstitialAdMob : NSObject @end diff --git a/mediation/mediatedviews/AdMob/ANAdAdapterInterstitialAdMob.m b/mediation/mediatedviews/AdMob/ANAdAdapterInterstitialAdMob.m index 804f34369..c3da96be7 100644 --- a/mediation/mediatedviews/AdMob/ANAdAdapterInterstitialAdMob.m +++ b/mediation/mediatedviews/AdMob/ANAdAdapterInterstitialAdMob.m @@ -15,6 +15,8 @@ #import "ANAdAdapterInterstitialAdMob.h" +#import "GADAdMobExtras.h" + @interface ANAdAdapterInterstitialAdMob () @property (nonatomic, readwrite, strong) GADInterstitial *interstitialAd; @@ -28,7 +30,7 @@ @implementation ANAdAdapterInterstitialAdMob - (void)requestInterstitialAdWithParameter:(NSString *)parameterString adUnitId:(NSString *)idString - targetingParameters:(ANTargetingParameters *)targetingParameters + targetingParameters:(ANTARGETINGPARAMETERS *)targetingParameters { NSLog(@"Requesting AdMob interstitial"); self.interstitialAd = [[GADInterstitial alloc] init]; @@ -54,10 +56,10 @@ - (BOOL)isReady { return self.interstitialAd.isReady; } -- (GADRequest *)createRequestFromTargetingParameters:(ANTargetingParameters *)targetingParameters { +- (GADRequest *)createRequestFromTargetingParameters:(ANTARGETINGPARAMETERS *)targetingParameters { GADRequest *request = [GADRequest request]; - ANGender gender = targetingParameters.gender; + ANGENDER gender = targetingParameters.gender; switch (gender) { case MALE: request.gender = kGADGenderMale; @@ -71,14 +73,16 @@ - (GADRequest *)createRequestFromTargetingParameters:(ANTargetingParameters *)ta break; } - ANLocation *location = targetingParameters.location; + ANLOCATION *location = targetingParameters.location; if (location) { [request setLocationWithLatitude:location.latitude longitude:location.longitude accuracy:location.horizontalAccuracy]; } - request.additionalParameters = targetingParameters.customKeywords; + GADAdMobExtras *extras = [GADAdMobExtras new]; + extras.additionalParameters = targetingParameters.customKeywords; + [request registerAdNetworkExtras:extras]; return request; } @@ -135,7 +139,7 @@ - (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADReque break; } - [self.delegate didFailToLoadAd:code]; + [self.delegate didFailToLoadAd:(ANADRESPONSECODE)code]; } - (void)interstitialWillPresentScreen:(GADInterstitial *)ad { diff --git a/mediation/mediatedviews/DFP/ANAdAdapterBannerDFP.h b/mediation/mediatedviews/DFP/ANAdAdapterBannerDFP.h index 22eadd65a..eabae1ce9 100644 --- a/mediation/mediatedviews/DFP/ANAdAdapterBannerDFP.h +++ b/mediation/mediatedviews/DFP/ANAdAdapterBannerDFP.h @@ -13,11 +13,12 @@ limitations under the License. */ -#import "ANCustomAdapter.h" +#import "ANBasicConfig.h" +#import ANCUSTOMADAPTERHEADER #import "DFPBannerView.h" #import "DFPSwipeableBannerView.h" #import "GADBannerViewDelegate.h" -@interface ANAdAdapterBannerDFP : NSObject +@interface ANAdAdapterBannerDFP : NSObject @end diff --git a/mediation/mediatedviews/DFP/ANAdAdapterBannerDFP.m b/mediation/mediatedviews/DFP/ANAdAdapterBannerDFP.m index d836b1901..63f3c810f 100644 --- a/mediation/mediatedviews/DFP/ANAdAdapterBannerDFP.m +++ b/mediation/mediatedviews/DFP/ANAdAdapterBannerDFP.m @@ -46,7 +46,7 @@ - (void)requestBannerAdWithSize:(CGSize)size rootViewController:(UIViewController *)rootViewController serverParameter:(NSString *)parameterString adUnitId:(NSString *)idString - targetingParameters:(ANTargetingParameters *)targetingParameters + targetingParameters:(ANTARGETINGPARAMETERS *)targetingParameters { NSLog(@"Requesting DFP banner with size: %0.1fx%0.1f", size.width, size.height); GADAdSize gadAdSize; @@ -78,11 +78,11 @@ - (void)requestBannerAdWithSize:(CGSize)size [self.dfpBanner loadRequest:request]; } -- (GADRequest *)createRequestFromTargetingParameters:(ANTargetingParameters *)targetingParameters +- (GADRequest *)createRequestFromTargetingParameters:(ANTARGETINGPARAMETERS *)targetingParameters { GADRequest *request = [GADRequest request]; - ANGender gender = targetingParameters.gender; + ANGENDER gender = targetingParameters.gender; switch (gender) { case MALE: request.gender = kGADGenderMale; @@ -96,7 +96,7 @@ - (GADRequest *)createRequestFromTargetingParameters:(ANTargetingParameters *)ta break; } - ANLocation *location = targetingParameters.location; + ANLOCATION *location = targetingParameters.location; if (location) { [request setLocationWithLatitude:location.latitude longitude:location.longitude @@ -190,7 +190,7 @@ - (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestErro break; } - [self.delegate didFailToLoadAd:code]; + [self.delegate didFailToLoadAd:(ANADRESPONSECODE)code]; } - (void)adViewWillPresentScreen:(DFPBannerView *)adView { diff --git a/mediation/mediatedviews/DFP/ANAdAdapterInterstitialDFP.h b/mediation/mediatedviews/DFP/ANAdAdapterInterstitialDFP.h index eb61e1660..75bc2f7ae 100644 --- a/mediation/mediatedviews/DFP/ANAdAdapterInterstitialDFP.h +++ b/mediation/mediatedviews/DFP/ANAdAdapterInterstitialDFP.h @@ -13,9 +13,10 @@ limitations under the License. */ -#import "ANCustomAdapter.h" +#import "ANBasicConfig.h" +#import ANCUSTOMADAPTERHEADER #import "DFPInterstitial.h" -@interface ANAdAdapterInterstitialDFP : NSObject +@interface ANAdAdapterInterstitialDFP : NSObject @end diff --git a/mediation/mediatedviews/DFP/ANAdAdapterInterstitialDFP.m b/mediation/mediatedviews/DFP/ANAdAdapterInterstitialDFP.m index 352d95f11..b8bd281f0 100644 --- a/mediation/mediatedviews/DFP/ANAdAdapterInterstitialDFP.m +++ b/mediation/mediatedviews/DFP/ANAdAdapterInterstitialDFP.m @@ -30,7 +30,7 @@ @implementation ANAdAdapterInterstitialDFP - (void)requestInterstitialAdWithParameter:(NSString *)parameterString adUnitId:(NSString *)idString - targetingParameters:(ANTargetingParameters *)targetingParameters + targetingParameters:(ANTARGETINGPARAMETERS *)targetingParameters { NSLog(@"Requesting DFP interstitial"); self.interstitialAd = [[DFPInterstitial alloc] init]; @@ -56,10 +56,10 @@ - (BOOL)isReady { return self.interstitialAd.isReady; } -- (GADRequest *)createRequestFromTargetingParameters:(ANTargetingParameters *)targetingParameters { +- (GADRequest *)createRequestFromTargetingParameters:(ANTARGETINGPARAMETERS *)targetingParameters { GADRequest *request = [GADRequest request]; - ANGender gender = targetingParameters.gender; + ANGENDER gender = targetingParameters.gender; switch (gender) { case MALE: request.gender = kGADGenderMale; @@ -73,7 +73,7 @@ - (GADRequest *)createRequestFromTargetingParameters:(ANTargetingParameters *)ta break; } - ANLocation *location = targetingParameters.location; + ANLOCATION *location = targetingParameters.location; if (location) { [request setLocationWithLatitude:location.latitude longitude:location.longitude @@ -147,7 +147,7 @@ - (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADReque break; } - [self.delegate didFailToLoadAd:code]; + [self.delegate didFailToLoadAd:(ANADRESPONSECODE)code]; } - (void)interstitialWillPresentScreen:(DFPInterstitial *)ad { diff --git a/mediation/mediatedviews/MillennialMedia/ANAdAdapterBannerMillennialMedia.h b/mediation/mediatedviews/MillennialMedia/ANAdAdapterBannerMillennialMedia.h index b510e9c73..b20caf0ed 100644 --- a/mediation/mediatedviews/MillennialMedia/ANAdAdapterBannerMillennialMedia.h +++ b/mediation/mediatedviews/MillennialMedia/ANAdAdapterBannerMillennialMedia.h @@ -16,6 +16,6 @@ #import "ANAdAdapterMillennialMediaBase.h" -@interface ANAdAdapterBannerMillennialMedia : ANAdAdapterMillennialMediaBase +@interface ANAdAdapterBannerMillennialMedia : ANAdAdapterMillennialMediaBase @end diff --git a/mediation/mediatedviews/MillennialMedia/ANAdAdapterBannerMillennialMedia.m b/mediation/mediatedviews/MillennialMedia/ANAdAdapterBannerMillennialMedia.m index a7a8adac7..d0dda4228 100644 --- a/mediation/mediatedviews/MillennialMedia/ANAdAdapterBannerMillennialMedia.m +++ b/mediation/mediatedviews/MillennialMedia/ANAdAdapterBannerMillennialMedia.m @@ -13,10 +13,9 @@ limitations under the License. */ - #import "ANAdAdapterBannerMillennialMedia.h" -#import "MMAdView.h" +#import @interface ANAdAdapterBannerMillennialMedia () @property (strong, nonatomic) CLLocationManager *locationManager; @@ -32,7 +31,7 @@ - (void)requestBannerAdWithSize:(CGSize)size rootViewController:(UIViewController *)rootViewController serverParameter:(NSString *)parameterString adUnitId:(NSString *)idString - targetingParameters:(ANTargetingParameters *)targetingParameters + targetingParameters:(ANTARGETINGPARAMETERS *)targetingParameters { NSLog(@"Requesting MillennialMedia banner with size %fx%f", size.width, size.height); [MMSDK initialize]; @@ -70,7 +69,7 @@ - (void)requestBannerAdWithSize:(CGSize)size break; } - [self.delegate didFailToLoadAd:code]; + [self.delegate didFailToLoadAd:(ANADRESPONSECODE)code]; } }]; } diff --git a/mediation/mediatedviews/MillennialMedia/ANAdAdapterInterstitialMillennialMedia.h b/mediation/mediatedviews/MillennialMedia/ANAdAdapterInterstitialMillennialMedia.h index 9ff33deed..57943d70d 100644 --- a/mediation/mediatedviews/MillennialMedia/ANAdAdapterInterstitialMillennialMedia.h +++ b/mediation/mediatedviews/MillennialMedia/ANAdAdapterInterstitialMillennialMedia.h @@ -16,6 +16,6 @@ #import "ANAdAdapterMillennialMediaBase.h" -@interface ANAdAdapterInterstitialMillennialMedia : ANAdAdapterMillennialMediaBase +@interface ANAdAdapterInterstitialMillennialMedia : ANAdAdapterMillennialMediaBase @end diff --git a/mediation/mediatedviews/MillennialMedia/ANAdAdapterInterstitialMillennialMedia.m b/mediation/mediatedviews/MillennialMedia/ANAdAdapterInterstitialMillennialMedia.m index 86cf9d47b..9eaa8626b 100644 --- a/mediation/mediatedviews/MillennialMedia/ANAdAdapterInterstitialMillennialMedia.m +++ b/mediation/mediatedviews/MillennialMedia/ANAdAdapterInterstitialMillennialMedia.m @@ -13,10 +13,9 @@ limitations under the License. */ - #import "ANAdAdapterInterstitialMillennialMedia.h" -#import "MMInterstitial.h" +#import @interface ANAdAdapterInterstitialMillennialMedia () @property (nonatomic, readwrite, strong) NSString *apid; @@ -29,7 +28,7 @@ @implementation ANAdAdapterInterstitialMillennialMedia - (void)requestInterstitialAdWithParameter:(NSString *)parameterString adUnitId:(NSString *)idString - targetingParameters:(ANTargetingParameters *)targetingParameters + targetingParameters:(ANTARGETINGPARAMETERS *)targetingParameters { NSLog(@"Requesting MillennialMedia interstitial"); [MMSDK initialize]; @@ -74,7 +73,7 @@ - (void)requestInterstitialAdWithParameter:(NSString *)parameterString break; } - [self.delegate didFailToLoadAd:code]; + [self.delegate didFailToLoadAd:(ANADRESPONSECODE)code]; } }]; diff --git a/mediation/mediatedviews/MillennialMedia/ANAdAdapterMillennialMediaBase.h b/mediation/mediatedviews/MillennialMedia/ANAdAdapterMillennialMediaBase.h index 013d1aa32..1d16e2481 100644 --- a/mediation/mediatedviews/MillennialMedia/ANAdAdapterMillennialMediaBase.h +++ b/mediation/mediatedviews/MillennialMedia/ANAdAdapterMillennialMediaBase.h @@ -13,12 +13,13 @@ limitations under the License. */ -#import "ANCustomAdapter.h" -#import "MMRequest.h" +#import "ANBasicConfig.h" +#import ANCUSTOMADAPTERHEADER +#import #import -@interface ANAdAdapterMillennialMediaBase : NSObject +@interface ANAdAdapterMillennialMediaBase : NSObject - (void) addMMNotificationObservers; -- (MMRequest *)createRequestFromTargetingParameters:(ANTargetingParameters *)targetingParameters; +- (MMRequest *)createRequestFromTargetingParameters:(ANTARGETINGPARAMETERS *)targetingParameters; @end diff --git a/mediation/mediatedviews/MillennialMedia/ANAdAdapterMillennialMediaBase.m b/mediation/mediatedviews/MillennialMedia/ANAdAdapterMillennialMediaBase.m index 2747d8633..ad2f361a5 100644 --- a/mediation/mediatedviews/MillennialMedia/ANAdAdapterMillennialMediaBase.m +++ b/mediation/mediatedviews/MillennialMedia/ANAdAdapterMillennialMediaBase.m @@ -15,7 +15,7 @@ #import "ANAdAdapterMillennialMediaBase.h" -#import "MMAdView.h" +#import @implementation ANAdAdapterMillennialMediaBase @synthesize delegate; @@ -62,10 +62,10 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; } -- (MMRequest *)createRequestFromTargetingParameters:(ANTargetingParameters *)targetingParameters { +- (MMRequest *)createRequestFromTargetingParameters:(ANTARGETINGPARAMETERS *)targetingParameters { MMRequest *request = [MMRequest request]; - ANGender gender = targetingParameters.gender; + ANGENDER gender = targetingParameters.gender; switch (gender) { case MALE: request.gender = MMGenderMale; @@ -79,7 +79,7 @@ - (MMRequest *)createRequestFromTargetingParameters:(ANTargetingParameters *)tar break; } - ANLocation *location = targetingParameters.location; + ANLOCATION *location = targetingParameters.location; if (location) { request.location = [[CLLocation alloc] initWithCoordinate:CLLocationCoordinate2DMake(location.latitude, location.longitude) diff --git a/mediation/mediatedviews/iAd/ANAdAdapterBanneriAd.h b/mediation/mediatedviews/iAd/ANAdAdapterBanneriAd.h index cbaf7817d..1917cd2ee 100644 --- a/mediation/mediatedviews/iAd/ANAdAdapterBanneriAd.h +++ b/mediation/mediatedviews/iAd/ANAdAdapterBanneriAd.h @@ -13,11 +13,12 @@ limitations under the License. */ -#import "ANCustomAdapter.h" +#import "ANBasicConfig.h" +#import ANCUSTOMADAPTERHEADER #import #import -@interface ANAdAdapterBanneriAd : NSObject +@interface ANAdAdapterBanneriAd : NSObject @end \ No newline at end of file diff --git a/mediation/mediatedviews/iAd/ANAdAdapterBanneriAd.m b/mediation/mediatedviews/iAd/ANAdAdapterBanneriAd.m index b9e4bf1c6..e9549ffe8 100644 --- a/mediation/mediatedviews/iAd/ANAdAdapterBanneriAd.m +++ b/mediation/mediatedviews/iAd/ANAdAdapterBanneriAd.m @@ -29,7 +29,7 @@ - (void)requestBannerAdWithSize:(CGSize)size rootViewController:(UIViewController *)rootViewController serverParameter:(NSString *)parameterString adUnitId:(NSString *)idString - targetingParameters:(ANTargetingParameters *)targetingParameters + targetingParameters:(ANTARGETINGPARAMETERS *)targetingParameters { NSLog(@"Requesting iAd banner"); Class iAdBannerClass = NSClassFromString(@"ADBannerView"); @@ -37,7 +37,7 @@ - (void)requestBannerAdWithSize:(CGSize)size self.bannerView = [[iAdBannerClass alloc] initWithAdType:ADAdTypeBanner]; [self.bannerView setDelegate:self]; } else { - [self.delegate didFailToLoadAd:ANAdResponseMediatedSDKUnavailable]; + [self.delegate didFailToLoadAd:(ANADRESPONSECODE)ANAdResponseMediatedSDKUnavailable]; } } @@ -75,7 +75,7 @@ - (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError * break; } - [self.delegate didFailToLoadAd:code]; + [self.delegate didFailToLoadAd:(ANADRESPONSECODE)code]; } - (void)bannerViewWillLoadAd:(ADBannerView *)banner { diff --git a/mediation/mediatedviews/iAd/ANAdAdapterInterstitialiAd.h b/mediation/mediatedviews/iAd/ANAdAdapterInterstitialiAd.h index 2a1cabe92..67b396ae2 100644 --- a/mediation/mediatedviews/iAd/ANAdAdapterInterstitialiAd.h +++ b/mediation/mediatedviews/iAd/ANAdAdapterInterstitialiAd.h @@ -13,11 +13,12 @@ limitations under the License. */ -#import "ANCustomAdapter.h" +#import "ANBasicConfig.h" +#import ANCUSTOMADAPTERHEADER #import #import -@interface ANAdAdapterInterstitialiAd : NSObject +@interface ANAdAdapterInterstitialiAd : NSObject @end diff --git a/mediation/mediatedviews/iAd/ANAdAdapterInterstitialiAd.m b/mediation/mediatedviews/iAd/ANAdAdapterInterstitialiAd.m index b2d5f0603..7aa0e36e5 100644 --- a/mediation/mediatedviews/iAd/ANAdAdapterInterstitialiAd.m +++ b/mediation/mediatedviews/iAd/ANAdAdapterInterstitialiAd.m @@ -27,7 +27,7 @@ @implementation ANAdAdapterInterstitialiAd // iAd doesn't have use placement id - (void)requestInterstitialAdWithParameter:(NSString *)parameterString adUnitId:(NSString *)idString - targetingParameters:(ANTargetingParameters *)targetingParameters + targetingParameters:(ANTARGETINGPARAMETERS *)targetingParameters { NSLog(@"Requesting iAd interstitial"); Class iAdInterstitialClass = NSClassFromString(@"ADInterstitialAd"); @@ -35,7 +35,7 @@ - (void)requestInterstitialAdWithParameter:(NSString *)parameterString self.interstitialAd = [[iAdInterstitialClass alloc] init]; [self.interstitialAd setDelegate:self]; } else { - [self.delegate didFailToLoadAd:ANAdResponseMediatedSDKUnavailable]; + [self.delegate didFailToLoadAd:(ANADRESPONSECODE)ANAdResponseMediatedSDKUnavailable]; } } @@ -126,7 +126,7 @@ - (void)interstitialAd:(ADInterstitialAd *)interstitialAd didFailWithError:(NSEr break; } - [self.delegate didFailToLoadAd:code]; + [self.delegate didFailToLoadAd:(ANADRESPONSECODE)code]; } @end diff --git a/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPBannerView.h b/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPBannerView.h index 2eb2fa536..1810fe82b 100644 --- a/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPBannerView.h +++ b/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPBannerView.h @@ -10,45 +10,44 @@ @protocol GADAdSizeDelegate; @protocol GADAppEventDelegate; +/// The view that displays DoubleClick For Publishers banner ads. @interface DFPBannerView : GADBannerView -// Optional delegate object that will be notified if a creative sends -// app events. Remember to nil out this property before releasing the object -// that implements the GADAppEventDelegate protocol to avoid crashing the app. -@property(nonatomic, assign) NSObject *appEventDelegate; - -// Optional delegate object that will be notified if a creative causes the -// banner to change size. Remember to nil out this property before releasing the -// object that implements the GADAdSizeDelegate protocol to avoid crashing the -// app. -@property(nonatomic, assign) NSObject *adSizeDelegate; - -// Optional array of GADAdSize to specify all valid sizes that are appropriate -// for this slot. Never create your own GADAdSize directly. Use one of the -// predefined standard ad sizes (such as kGADAdSizeBanner), or create one using -// the GADAdSizeFromCGSize method. -// -// Example code: -// GADAdSize size1 = GADAdSizeFromCGSize(CGSizeMake(320, 50)); -// GADAdSize size2 = GADAdSizeFromCGSize(CGSizeMake(300, 50)); -// NSMutableArray *validSizes = [NSMutableArray array]; -// [validSizes addObject:[NSValue valueWithBytes:&size1 -// objCType:@encode(GADAdSize)]]; -// [validSizes addObject:[NSValue valueWithBytes:&size2 -// objCType:@encode(GADAdSize)]]; -// -// myView.validAdSizes = validSizes; -@property(nonatomic, retain) NSArray *validAdSizes; - -// Flag allowing publisher to specify when the ad is visible to the user. +/// Optional delegate that is notified when creatives send app events. To avoid crashing the app, +/// remember to nil this property before releasing the object that implements the +/// GADAppEventDelegate protocol. +@property(nonatomic, weak) NSObject *appEventDelegate; + +/// Optional delegate that is notified when creatives cause the banner to change size. To avoid +/// crashing the app, remember to nil this property before releasing the object that implements the +/// GADAdSizeDelegate protocol. +@property(nonatomic, weak) NSObject *adSizeDelegate; + +/// Optional array of NSValue encoded GADAdSize structs, specifying all valid sizes that are +/// appropriate for this slot. Never create your own GADAdSize directly. Use one of the predefined +/// standard ad sizes (such as kGADAdSizeBanner), or create one using the GADAdSizeFromCGSize +/// method. +/// +/// Example: +/// \code +/// GADAdSize size1 = GADAdSizeFromCGSize(CGSizeMake(320, 50)); +/// GADAdSize size2 = GADAdSizeFromCGSize(CGSizeMake(300, 50)); +/// NSMutableArray *validSizes = [NSMutableArray array]; +/// [validSizes addObject:[NSValue valueWithBytes:&size1 objCType:@encode(GADAdSize)]]; +/// [validSizes addObject:[NSValue valueWithBytes:&size2 objCType:@encode(GADAdSize)]]; +/// +/// myView.validAdSizes = validSizes; +/// \endcode +@property(nonatomic, strong) NSArray *validAdSizes; + +/// Indicates that the publisher will record impressions manually when the ad becomes visible to the +/// user. @property(nonatomic, assign) BOOL enableManualImpressions; -// Call this when the ad is visible and if you have set enableManualImpressions -// to YES. +/// If you've set enableManualImpressions to YES, call this method when the ad is visible. - (void)recordImpression; -// Use this function to resize the banner view without launching a new ad -// request. +/// Use this function to resize the banner view without launching a new ad request. - (void)resize:(GADAdSize)size; @end diff --git a/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPExtras.h b/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPExtras.h index 2aa63aeb3..3dd213d7e 100644 --- a/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPExtras.h +++ b/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPExtras.h @@ -17,6 +17,9 @@ @interface DFPExtras : GADAdMobExtras +/// Content URL for targeting information. +@property(nonatomic, copy) NSString *contentURL; +/// Publisher provided user ID. @property(nonatomic, copy) NSString *publisherProvidedID; @end diff --git a/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPInterstitial.h b/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPInterstitial.h index 8041d764f..f8bbe849e 100644 --- a/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPInterstitial.h +++ b/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPInterstitial.h @@ -11,6 +11,6 @@ @interface DFPInterstitial : GADInterstitial -@property(nonatomic, assign) NSObject *appEventDelegate; +@property(nonatomic, weak) NSObject *appEventDelegate; @end diff --git a/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPSwipeableBannerView.h b/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPSwipeableBannerView.h index ab0ca394f..3284f517b 100644 --- a/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPSwipeableBannerView.h +++ b/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/DFPSwipeableBannerView.h @@ -10,8 +10,8 @@ @interface DFPSwipeableBannerView : DFPBannerView -// Set a delegate to be notified when the user activates and deactivates an ad. -// Remember to nil out the delegate before releasing this banner. -@property(nonatomic, assign) NSObject *swipeDelegate; +/// Set a delegate to be notified when the user activates and deactivates an ad. Remember to nil out +/// the delegate before releasing this banner. +@property(nonatomic, weak) NSObject *swipeDelegate; @end diff --git a/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/GADAppEventDelegate.h b/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/GADAppEventDelegate.h index 06e4e0e8a..a745cadae 100644 --- a/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/GADAppEventDelegate.h +++ b/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/GADAppEventDelegate.h @@ -11,8 +11,8 @@ @protocol GADAppEventDelegate -// Implement your app event within these methods. The delegate will be notified -// when the SDK receives an app event message from the ad. +/// Implement your app event within these methods. The delegate will be notified when the SDK +/// receives an app event message from the ad. @optional - (void)adView:(GADBannerView *)banner diff --git a/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/GADSwipeableBannerViewDelegate.h b/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/GADSwipeableBannerViewDelegate.h index f1e0a7fad..ec8e04263 100644 --- a/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/GADSwipeableBannerViewDelegate.h +++ b/mediation/mediatedviews/libs/AdMob/Add-ons/DoubleClick/GADSwipeableBannerViewDelegate.h @@ -4,16 +4,15 @@ // // Copyright (c) 2012 Google Inc. All rights reserved. // -// The delegate will be notified when a user activates and deactivates an ad. -// If the DFPSwipeableBannerView is contained within a UIScrollView, make sure -// to set scrollEnabled = NO when -adViewDidActivateAd: is notified and to set -// back to YES when -adViewDidDeactivateAd: is notified. -// #import @class GADBannerView; +/// The delegate will be notified when a user activates and deactivates an ad. If the +/// DFPSwipeableBannerView is contained within a UIScrollView, make sure to set scrollEnabled to NO +/// when -adViewDidActivateAd: is called and to set back to YES when -adViewDidDeactivateAd: is +/// called. @protocol GADSwipeableBannerViewDelegate @optional diff --git a/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventBanner.h b/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventBanner.h index ed47d7125..0adad1f1b 100644 --- a/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventBanner.h +++ b/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventBanner.h @@ -10,36 +10,28 @@ #import "GADCustomEventBannerDelegate.h" #import "GADCustomEventRequest.h" -// The protocol for a Custom Event of the banner type. -// Your Custom Event handler object for banners must implement this protocol. -// The requestBannerAd method will be called when Mediation schedules your -// Custom Event to be executed. +/// The protocol for a Custom Event of the banner type. Your Custom Event handler object for banners +/// must implement this protocol. The requestBannerAd method will be called when mediation schedules +/// your Custom Event to be executed. @protocol GADCustomEventBanner -// This method is called by Mediation when your Custom Event is scheduled to -// be executed. Results of the execution should be reported back via the -// delegate. |adSize| is the size of the ad as configured in the Mediation UI -// for the Mediation Placement. |serverParameter| and |serverLabel| are the -// parameter and label configured in the Mediation UI for the Custom Event. -// |request| contains information about the ad request, some of those are from -// GADRequest. +/// This method is called by mediation when your Custom Event is scheduled to be executed. Results +/// of the execution should be reported back via the delegate. |adSize| is the size of the ad as +/// configured in the mediation UI for the mediation placement. |serverParameter| and |serverLabel| +/// are the parameter and label configured in the mediation UI for the Custom Event. |request| +/// contains information about the ad request, some of those are from GADRequest. - (void)requestBannerAd:(GADAdSize)adSize parameter:(NSString *)serverParameter label:(NSString *)serverLabel request:(GADCustomEventRequest *)request; -// You should call back to the |delegate| with the results of the execution -// to ensure Mediation behaves correctly. The delegate is assigned, not -// retained, to prevent memory leak caused by circular retention. -// -// You can create accessor methods either by doing -// -// @synthesize delegate; -// -// in your class implementation, or define the methods -delegate and -// -setDelegate: yourself. -// -// In your object's -dealloc method, remember to nil out the delegate. -@property(nonatomic, assign) id delegate; +/// You should call back to the |delegate| with the results of the execution to ensure mediation +/// behaves correctly. The delegate is weakly referenced to prevent memory leaks caused by circular +/// retention. +/// +/// Define the -delegate and -setDelegate: methods in your class. +/// +/// In your class's -dealloc method, remember to nil out the delegate. +@property(nonatomic, weak) id delegate; @end diff --git a/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventBannerDelegate.h b/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventBannerDelegate.h index 912023a60..91ff21170 100644 --- a/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventBannerDelegate.h +++ b/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventBannerDelegate.h @@ -1,58 +1,53 @@ -// -// GADCustomEventBannerDelegate.h -// Google AdMob Ads SDK -// -// Copyright 2012 Google Inc. All rights reserved. -// -// Call back to this delegate in your custom event. You must call -// customEventBanner:didReceiveAd: when there is an ad to show, or -// customEventBanner:didFailAd: when there is no ad to show. Otherwise, if -// enough time passed (several seconds) after the SDK called the -// requestBannerAd: method of your custom event, the mediation SDK will consider -// the request timed out, and move on to the next ad network. -// +/// +/// GADCustomEventBannerDelegate.h +/// Google AdMob Ads SDK +/// +/// Copyright 2012 Google Inc. All rights reserved. +/// #import @protocol GADCustomEventBanner; +/// Call back to this delegate in your custom event. You must call customEventBanner:didReceiveAd: +/// when there is an ad to show, or customEventBanner:didFailAd: when there is no ad to show. +/// Otherwise, if enough time passed (several seconds) after the SDK called the requestBannerAd: +/// method of your custom event, the mediation SDK will consider the request timed out, and move on +/// to the next ad network. @protocol GADCustomEventBannerDelegate -// Your Custom Event object must call this when it receives or creates an ad -// view. +/// Your Custom Event object must call this when it receives or creates an ad view. - (void)customEventBanner:(id)customEvent didReceiveAd:(UIView *)view; -// Your Custom Event object must call this when it fails to receive or -// create the ad view. Pass along any error object sent from the ad network's -// SDK, or an NSError describing the error. Pass nil if not available. +/// Your Custom Event object must call this when it fails to receive or create the ad view. Pass +/// along any error object sent from the ad network's SDK, or an NSError describing the error. Pass +/// nil if not available. - (void)customEventBanner:(id)customEvent didFailAd:(NSError *)error; -// Your Custom Event object should call this when the user touches or "clicks" -// the ad to initiate an action. When the SDK receives this callback, it reports -// the click back to the Mediation server. This callback is optional. +/// Your Custom Event object should call this when the user touches or "clicks" the ad to initiate +/// an action. When the SDK receives this callback, it reports the click back to the Mediation +/// server. This callback is optional. - (void)customEventBanner:(id)customEvent clickDidOccurInAd:(UIView *)view; -// The rootViewController that you set in GADBannerView. -// Use this UIViewController to show a modal view when a user taps on the ad. +/// The rootViewController that you set in GADBannerView. Use this UIViewController to show a modal +/// view when a user taps on the ad. @property(nonatomic, readonly) UIViewController *viewControllerForPresentingModalView; -// When you call the following methods, the call will be propagated back to the -// GADBannerViewDelegate that you implemented and passed to GADBannerView. +/// When you call the following methods, the call will be propagated back to the +/// GADBannerViewDelegate that you implemented and passed to GADBannerView. -// Your Custom Event should call this when the user taps an ad and a modal view -// appears. +/// Your Custom Event should call this when the user taps an ad and a modal view appears. - (void)customEventBannerWillPresentModal:(id)customEvent; -// Your Custom Event should call this when the user dismisses the modal view -// and the modal view is about to go away. +/// Your Custom Event should call this when the user dismisses the modal view and the modal view is +/// about to go away. - (void)customEventBannerWillDismissModal:(id)customEvent; -// Your Custom Event should call this when the user dismisses the modal view -// and the modal view has gone away. +/// Your Custom Event should call this when the user dismisses the modal view and the modal view has +/// gone away. - (void)customEventBannerDidDismissModal:(id)customEvent; -// Your Custom Event should call this method when a user action will result in -// App switching. +/// Your Custom Event should call this method when a user action will result in App switching. - (void)customEventBannerWillLeaveApplication:(id)customEvent; @end diff --git a/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventExtras.h b/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventExtras.h index 18ed396cc..382932191 100644 --- a/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventExtras.h +++ b/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventExtras.h @@ -1,32 +1,30 @@ -// -// GADCustomEventExtras.h -// Google Ads iOS SDK -// -// Copyright (c) 2012 Google Inc. All rights reserved. -// -// Create an instance of this class to set additional parameters for each -// custom event object. The additional parameters for a custom event are -// keyed by the custom event label. These extras are passed to your -// implementation of GADCustomEventBanner or GADCustomEventInterstitial. -// +/// +/// GADCustomEventExtras.h +/// Google Ads iOS SDK +/// +/// Copyright (c) 2012 Google Inc. All rights reserved. +/// #import #import "GADAdNetworkExtras.h" +/// Create an instance of this class to set additional parameters for each custom event object. The +/// additional parameters for a custom event are keyed by the custom event label. These extras are +/// passed to your implementation of GADCustomEventBanner or GADCustomEventInterstitial. @interface GADCustomEventExtras : NSObject -// Set additional parameters for the custom event with label |label|. To remove -// additional parameters associated with |label|, pass in nil for |extras|. +/// Set additional parameters for the custom event with label |label|. To remove additional +/// parameters associated with |label|, pass in nil for |extras|. - (void)setExtras:(NSDictionary *)extras forLabel:(NSString *)label; -// Retrieve the extras for |label|. +/// Retrieve the extras for |label|. - (NSDictionary *)extrasForLabel:(NSString *)label; -// Removes all the extras set on this instance. +/// Removes all the extras set on this instance. - (void)removeAllExtras; -// Returns all the extras set on this instance. +/// Returns all the extras set on this instance. - (NSDictionary *)allExtras; @end diff --git a/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventInterstitial.h b/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventInterstitial.h index 302063a4f..34ad93184 100644 --- a/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventInterstitial.h +++ b/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventInterstitial.h @@ -9,44 +9,35 @@ #import "GADCustomEventInterstitialDelegate.h" #import "GADCustomEventRequest.h" -// The protocol for a Custom Event of the interstitial type. -// Your Custom Event handler object for interstitial must implement this -// protocol. The requestInterstitialAd method will be called when Mediation -// schedules your Custom Event to be executed. +/// The protocol for a Custom Event of the interstitial type. Your Custom Event handler object for +/// interstitial must implement this protocol. The requestInterstitialAd method will be called when +/// mediation schedules your Custom Event to be executed. @protocol GADCustomEventInterstitial -// This method is called by Mediation when your Custom Event is scheduled to -// be executed. Your implementation should begin retrieval of the interstitial -// ad, usually from a backend server, or from an ad network SDK. Results of the -// execution should be reported back via the delegate. Note that you should wait -// until -presentFromRootViewController is called before displaying the -// interstitial ad. Do not automatically display the ad when you receive the ad. -// Instead, retain the ad and display it when presentFromRootViewController is -// called. -// |serverParameter| and |serverLabel| are the parameter and -// label configured in the AdMob Mediation UI for the Custom Event. |request| -// contains information about the ad request, some of those are from GADRequest. +/// You should call back to the |delegate| with the results of the execution to ensure mediation +/// behaves correctly. The delegate is assigned, not retained, to prevent memory leak caused by +/// circular retention. +/// +/// Define the -delegate and -setDelegate: methods in your class. +/// +/// In your class's -dealloc method, remember to nil out the delegate. +@property(nonatomic, weak) id delegate; + +/// This method is called by mediation when your Custom Event is scheduled to be executed. Your +/// implementation should begin retrieval of the interstitial ad, usually from a backend server, or +/// from an ad network SDK. Results of the execution should be reported back via the delegate. Note +/// that you should wait until -presentFromRootViewController is called before displaying the +/// interstitial ad. Do not automatically display the ad when you receive the ad. Instead, retain +/// the ad and display it when presentFromRootViewController is called. |serverParameter| and +/// |serverLabel| are the parameter and label configured in the AdMob mediation UI for the Custom +/// Event. |request| contains information about the ad request, some of those are from GADRequest. - (void)requestInterstitialAdWithParameter:(NSString *)serverParameter label:(NSString *)serverLabel request:(GADCustomEventRequest *)request; -// Present the interstitial ad as a modal view using the provided view -// controller. This is called only after your Custom Event calls back -// to the delegate with the message -customEvent:didReceiveAd: . +/// Present the interstitial ad as a modal view using the provided view controller. This is called +/// only after your Custom Event calls back to the delegate with the message +/// -customEvent:didReceiveAd: . - (void)presentFromRootViewController:(UIViewController *)rootViewController; -// You should call back to the |delegate| with the results of the execution -// to ensure Mediation behaves correctly. The delegate is assigned, not -// retained, to prevent memory leak caused by circular retention. -// -// You can create accessor methods either by doing -// -// @synthesize delegate; -// -// in your class implementation, or define the methods -delegate and -// -setDelegate: yourself. -// -// In your object's -dealloc method, remember to nil out the delegate. -@property(nonatomic, assign) id delegate; - @end diff --git a/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventInterstitialDelegate.h b/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventInterstitialDelegate.h index 6cf00787a..e57904611 100644 --- a/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventInterstitialDelegate.h +++ b/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventInterstitialDelegate.h @@ -4,49 +4,43 @@ // // Copyright 2012 Google Inc. All rights reserved. // -// Call back to this delegate in your custom event. You must call -// customEventInterstitial:didReceiveAd: when there is an ad to show, or -// customEventInterstitial:didFailAd: when there is no ad to show. Otherwise, if -// enough time passed (several seconds) after the SDK called the -// requestInterstitialAdWithParameter: method of your custom event, the -// mediation SDK will consider the request timed out, and move on to the next ad -// network. -// #import @protocol GADCustomEventInterstitial; +/// Call back to this delegate in your custom event. You must call +/// customEventInterstitial:didReceiveAd: when there is an ad to show, or +/// customEventInterstitial:didFailAd: when there is no ad to show. Otherwise, if enough time passed +/// (several seconds) after the SDK called the requestInterstitialAdWithParameter: method of your +/// custom event, the mediation SDK will consider the request timed out, and move on to the next ad +/// network. @protocol GADCustomEventInterstitialDelegate -// Your Custom Event object must call this when it receives or creates an -// interstitial ad. If there is an ad object, pass it in the method call. -// Pass nil if the ad object is not available. +/// Your Custom Event object must call this when it receives or creates an interstitial ad. If there +/// is an ad object, pass it in the method call. Pass nil if the ad object is not available. - (void)customEventInterstitial:(id)customEvent didReceiveAd:(NSObject *)ad; -// Your Custom Event object must call this when it fails to receive or -// create the ad. Pass along any error object sent from the ad network's -// SDK, or an NSError describing the error. Pass nil if not available. +/// Your Custom Event object must call this when it fails to receive or create the ad. Pass along +/// any error object sent from the ad network's SDK, or an NSError describing the error. Pass nil if +/// not available. - (void)customEventInterstitial:(id)customEvent didFailAd:(NSError *)error; -// When you call any of the the following methods, the call will be propagated -// back to the GADInterstitialDelegate that you implemented and passed to -// GADInterstitial. +/// When you call any of the the following methods, the call will be propagated back to the +/// GADInterstitialDelegate that you implemented and passed to GADInterstitial. -// Your Custom Event should call this when the interstitial is being displayed. +/// Your Custom Event should call this when the interstitial is being displayed. - (void)customEventInterstitialWillPresent:(id)customEvent; -// Your Custom Event should call this when the interstitial is about to be -// dismissed. +/// Your Custom Event should call this when the interstitial is about to be dismissed. - (void)customEventInterstitialWillDismiss:(id)customEvent; -// Your Custom Event should call this when the interstitial has been dismissed. +/// Your Custom Event should call this when the interstitial has been dismissed. - (void)customEventInterstitialDidDismiss:(id)customEvent; -// Your Custom Event should call this method when a user action will result in -// App switching. +/// Your Custom Event should call this method when a user action will result in app switching. - (void)customEventInterstitialWillLeaveApplication:(id)customEvent; @end diff --git a/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventRequest.h b/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventRequest.h index 1f64f36a4..83f8464e5 100644 --- a/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventRequest.h +++ b/mediation/mediatedviews/libs/AdMob/Add-ons/Mediation/GADCustomEventRequest.h @@ -13,38 +13,35 @@ @interface GADCustomEventRequest : NSObject -// The end user's gender set in GADRequest. If none specified, -// returns kGADGenderUnknown. -@property(nonatomic, readonly) GADGender userGender; - -// The end user's birthday set in GADRequest. If none specified, returns nil. -@property(nonatomic, readonly) NSDate *userBirthday; - -// The end user's latitude, longitude and accuracy, set in GADRequest. If -// none specified, hasLocation retuns NO, and userLatitude, userLongitude -// and userLocationAccuracyInMeters will all return 0. -@property(nonatomic, readonly) BOOL userHasLocation; -@property(nonatomic, readonly) CGFloat userLatitude; -@property(nonatomic, readonly) CGFloat userLongitude; -@property(nonatomic, readonly) CGFloat userLocationAccuracyInMeters; - -// Description of the user's location, in free form text, set in GADRequest. -// If not available, returns nil. This may be set even if userHasLocation -// is NO. -@property(nonatomic, readonly) NSString *userLocationDescription; - -// Keywords set in GADRequest. If none, returns nil. -@property(nonatomic, readonly) NSArray *userKeywords; - -// The additional parameters set by the app in GADRequest.h. This allows you -// to pass additional information from your app to your Custom Event object. To -// do so, create an instance of GADCustomEventExtras to pass to GADRequest -// -registerAdNetworkExtras:. The instance should have an NSDictionary set for a -// particular custom event label. That NSDictionary becomes the -// additionalParameters here. -@property(nonatomic, readonly) NSDictionary *additionalParameters; - -// Whether you have set the testing property in GADRequest. -@property(nonatomic, readonly) BOOL isTesting; +/// The end user's gender set in GADRequest. If not specified, returns kGADGenderUnknown. +@property(nonatomic, readonly, assign) GADGender userGender; + +/// The end user's birthday set in GADRequest. If not specified, returns nil. +@property(nonatomic, readonly, copy) NSDate *userBirthday; + +/// The end user's latitude, longitude, and accuracy, set in GADRequest. If not specified, +/// userHasLocation returns NO, and userLatitude, userLongitude and userLocationAccuracyInMeters +/// will all return 0. +@property(nonatomic, readonly, assign) BOOL userHasLocation; +@property(nonatomic, readonly, assign) CGFloat userLatitude; +@property(nonatomic, readonly, assign) CGFloat userLongitude; +@property(nonatomic, readonly, assign) CGFloat userLocationAccuracyInMeters; + +/// Description of the user's location, in free form text, set in GADRequest. If not available, +/// returns nil. This may be set even if userHasLocation is NO. +@property(nonatomic, readonly, copy) NSString *userLocationDescription; + +/// Keywords set in GADRequest. Returns nil if no keywords are set. +@property(nonatomic, readonly, copy) NSArray *userKeywords; + +/// The additional parameters set by the application. This property allows you to pass additional +/// information from your application to your Custom Event object. To do so, create an instance of +/// GADCustomEventExtras to pass to GADRequest -registerAdNetworkExtras:. The instance should have +/// an NSDictionary set for a particular custom event label. That NSDictionary becomes the +/// additionalParameters here. +@property(nonatomic, readonly, copy) NSDictionary *additionalParameters; + +/// Indicates if the testing property has been set in GADRequest. +@property(nonatomic, readonly, assign) BOOL isTesting; @end diff --git a/mediation/mediatedviews/libs/AdMob/GADAdMobExtras.h b/mediation/mediatedviews/libs/AdMob/GADAdMobExtras.h index 089a87d8e..16f0fce2f 100644 --- a/mediation/mediatedviews/libs/AdMob/GADAdMobExtras.h +++ b/mediation/mediatedviews/libs/AdMob/GADAdMobExtras.h @@ -4,15 +4,15 @@ // // Copyright (c) 2012 Google Inc. All rights reserved. // -// The additional parameters publishers may send to the AdMob network. -// #import #import "GADAdNetworkExtras.h" +#import "GADModules.h" @interface GADAdMobExtras : NSObject +/// The additional parameters publishers may send to the AdMob network. @property(nonatomic, copy) NSDictionary *additionalParameters; @end diff --git a/mediation/mediatedviews/libs/AdMob/GADAdNetworkExtras.h b/mediation/mediatedviews/libs/AdMob/GADAdNetworkExtras.h index 5fc9a54c6..9e7fd6106 100644 --- a/mediation/mediatedviews/libs/AdMob/GADAdNetworkExtras.h +++ b/mediation/mediatedviews/libs/AdMob/GADAdNetworkExtras.h @@ -4,15 +4,15 @@ // // Copyright (c) 2012 Google Inc. All rights reserved. // -// An object implementing this protocol contains information set by the -// publisher on the client device for a particular ad network. -// -// Ad networks should create an 'extras' object implementing this protocol for -// their publishers to use. -// #import -@protocol GADAdNetworkExtras +#import "GADModules.h" +/// An object implementing this protocol contains information set by the publisher on the client +/// device for a particular ad network. +/// +/// Ad networks should create an 'extras' object implementing this protocol for their publishers to +/// use. +@protocol GADAdNetworkExtras @end diff --git a/mediation/mediatedviews/libs/AdMob/GADAdSize.h b/mediation/mediatedviews/libs/AdMob/GADAdSize.h index 023ce84d4..06b1dbfa4 100644 --- a/mediation/mediatedviews/libs/AdMob/GADAdSize.h +++ b/mediation/mediatedviews/libs/AdMob/GADAdSize.h @@ -11,9 +11,11 @@ #import -// Do not create a GADAdSize manually. Use one of the kGADAdSize constants. -// Treat GADAdSize as an opaque type. Do not access any fields directly. To -// obtain a concrete CGSize, use the function CGSizeFromGADAdSize(). +#import "GADModules.h" + +/// Do not create a GADAdSize manually. Use one of the kGADAdSize constants. +/// Treat GADAdSize as an opaque type. Do not access any fields directly. To +/// obtain a concrete CGSize, use the function CGSizeFromGADAdSize(). typedef struct GADAdSize { CGSize size; NSUInteger flags; @@ -21,70 +23,71 @@ typedef struct GADAdSize { #pragma mark Standard Sizes -// iPhone and iPod Touch ad size. Typically 320x50. +/// iPhone and iPod Touch ad size. Typically 320x50. extern GADAdSize const kGADAdSizeBanner; -// Medium Rectangle size for the iPad (especially in a UISplitView's left pane). -// Typically 300x250. +/// Taller version of kGADAdSizeBanner. Typically 320x100. +extern GADAdSize const kGADAdSizeLargeBanner; + +/// Medium Rectangle size for the iPad (especially in a UISplitView's left pane). Typically 300x250. extern GADAdSize const kGADAdSizeMediumRectangle; -// Full Banner size for the iPad (especially in a UIPopoverController or in -// UIModalPresentationFormSheet). Typically 468x60. +/// Full Banner size for the iPad (especially in a UIPopoverController or in +/// UIModalPresentationFormSheet). Typically 468x60. extern GADAdSize const kGADAdSizeFullBanner; -// Leaderboard size for the iPad. Typically 728x90. +/// Leaderboard size for the iPad. Typically 728x90. extern GADAdSize const kGADAdSizeLeaderboard; -// Skyscraper size for the iPad. Mediation only. AdMob/Google does not offer -// this size. Typically 120x600. +/// Skyscraper size for the iPad. Mediation only. AdMob/Google does not offer this size. Typically +/// 120x600. extern GADAdSize const kGADAdSizeSkyscraper; -// An ad size that spans the full width of the application in portrait -// orientation. The height is typically 50 pixels on an iPhone/iPod UI, and 90 -// pixels tall on an iPad UI. +/// An ad size that spans the full width of the application in portrait orientation. The height is +/// typically 50 pixels on an iPhone/iPod UI, and 90 pixels tall on an iPad UI. extern GADAdSize const kGADAdSizeSmartBannerPortrait; -// An ad size that spans the full width of the application in landscape -// orientation. The height is typically 32 pixels on an iPhone/iPod UI, and 90 -// pixels tall on an iPad UI. +/// An ad size that spans the full width of the application in landscape orientation. The height is +/// typically 32 pixels on an iPhone/iPod UI, and 90 pixels tall on an iPad UI. extern GADAdSize const kGADAdSizeSmartBannerLandscape; -// Invalid ad size marker. +/// Invalid ad size marker. extern GADAdSize const kGADAdSizeInvalid; #pragma mark Custom Sizes -// Given a CGSize, return a custom GADAdSize. Use this only if you require a -// non-standard size, otherwise, use one of the standard size constants above. +/// Returns a custom GADAdSize for the provided CGSize. Use this only if you require a non-standard +/// size, otherwise, use one of the standard size constants above. GADAdSize GADAdSizeFromCGSize(CGSize size); -// Get a custom GADAdSize that spans the full width of the application in -// portrait orientation with the height provided. +/// Returns a custom GADAdSize that spans the full width of the application in portrait orientation +/// with the height provided. GADAdSize GADAdSizeFullWidthPortraitWithHeight(CGFloat height); -// Get a custom GADAdSize that spans the full width of the application in -// landscape orientation with the height provided. +/// Returns a custom GADAdSize that spans the full width of the application in landscape orientation +/// with the height provided. GADAdSize GADAdSizeFullWidthLandscapeWithHeight(CGFloat height); #pragma mark Convenience Functions -// Checks whether the two GADAdSizes are equal. +/// Returns YES if the two GADAdSizes are equal, otherwise returns NO. BOOL GADAdSizeEqualToSize(GADAdSize size1, GADAdSize size2); -// Given a GADAdSize constant, returns a CGSize. If the GADAdSize is unknown, -// returns CGSizeZero. +/// Returns a CGSize for the provided a GADAdSize constant. If the GADAdSize is unknown, returns +/// CGSizeZero. CGSize CGSizeFromGADAdSize(GADAdSize size); -// Returns YES if |size| is one of the predefined constants or is a custom -// GADAdSize generated by GADAdSizeFromCGSize. +/// Returns YES if |size| is one of the predefined constants or is a custom GADAdSize generated by +/// GADAdSizeFromCGSize. BOOL IsGADAdSizeValid(GADAdSize size); -// Given a GADAdSize constant, returns a NSString describing the GADAdSize. +/// Returns a NSString describing the provided GADAdSize. NSString *NSStringFromGADAdSize(GADAdSize size); #pragma mark Deprecated Macros #define GAD_SIZE_320x50 CGSizeFromGADAdSize(kGADAdSizeBanner) +#define GAD_SIZE_320x100 CGSizeFromGADAdSize(kGADAdSizeLargeBanner) #define GAD_SIZE_300x250 CGSizeFromGADAdSize(kGADAdSizeMediumRectangle) #define GAD_SIZE_468x60 CGSizeFromGADAdSize(kGADAdSizeFullBanner) #define GAD_SIZE_728x90 CGSizeFromGADAdSize(kGADAdSizeLeaderboard) diff --git a/mediation/mediatedviews/libs/AdMob/GADBannerView.h b/mediation/mediatedviews/libs/AdMob/GADBannerView.h index a4d8d0dde..48b49319a 100644 --- a/mediation/mediatedviews/libs/AdMob/GADBannerView.h +++ b/mediation/mediatedviews/libs/AdMob/GADBannerView.h @@ -6,115 +6,122 @@ // #import + #import "GADAdSize.h" #import "GADBannerViewDelegate.h" +#import "GADInAppPurchaseDelegate.h" +#import "GADModules.h" #import "GADRequest.h" #import "GADRequestError.h" -// The view that displays banner ads. A minimum implementation to get an ad -// from within a UIViewController class is: -// -// // Create and setup the ad view, specifying the size and origin at {0, 0}. -// GADBannerView *adView = -// [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner]; -// adView.rootViewController = self; -// adView.adUnitID = @"ID created when registering my app"; -// -// // Place the ad view onto the screen. -// [self.view addSubview:adView]; -// [adView release]; -// -// // Request an ad without any additional targeting information. -// [adView loadRequest:nil]; -// +/// The view that displays banner ads. A minimum implementation to get an ad +/// from within a UIViewController class is: +/// +/// \code +/// // Create and setup the ad view, specifying the size and origin at {0, 0}. +/// GADBannerView *adView = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner]; +/// adView.rootViewController = self; +/// adView.adUnitID = @"ID created when registering my app"; +/// +/// // Place the ad view onto the screen. +/// [self.view addSubview:adView]; +/// [adView release]; +/// +/// // Request an ad without any additional targeting information. +/// [adView loadRequest:nil]; +/// \endcode +/// @interface GADBannerView : UIView #pragma mark Initialization -// Initializes a GADBannerView and sets it to the specified size, and specifies -// its placement within its superview bounds. If |size| is invalid, an -// instance of GADBannerView is not created and nil is returned instead. +/// Initializes a GADBannerView and sets it to the specified size, and specifies its placement +/// within its superview bounds. If |size| is invalid, an instance of GADBannerView is not created +/// and nil is returned instead. - (id)initWithAdSize:(GADAdSize)size origin:(CGPoint)origin; -// Initializes a GADBannerView and sets it to the specified size, and specifies -// its placement at the top left of its superview. If |size| is invalid, an -// instance of GADBannerView is not created and nil is returned instead. +/// Initializes a GADBannerView and sets it to the specified size, and specifies its placement at +/// the top left of its superview. If |size| is invalid, an instance of GADBannerView is not created +/// and nil is returned instead. - (id)initWithAdSize:(GADAdSize)size; #pragma mark Pre-Request -// Required value created in the AdSense website. Create a new ad unit for -// every unique placement of an ad in your application. Set this to the ID -// assigned for this placement. Ad units are important for targeting and stats. -// Example values for different request types: -// AdMob: a0123456789ABCD -// DFP: /0123/ca-pub-0123456789012345/my-ad-identifier -// AdSense: ca-mb-app-pub-0123456789012345/my-ad-identifier -// Mediation: AB123456789ABCDE +/// Required value created in the AdSense website. Create a new ad unit for every unique placement +/// of an ad in your application. Set this to the ID assigned for this placement. Ad units are +/// important for targeting and stats. +/// Example values for different request types: +/// +/// AdMob: a0123456789ABCD +/// DFP: /0123/ca-pub-0123456789012345/my-ad-identifier +/// AdSense: ca-mb-app-pub-0123456789012345/my-ad-identifier +/// Mediation: AB123456789ABCDE @property(nonatomic, copy) NSString *adUnitID; -// Required reference to the current root view controller. For example the root -// view controller in tab-based application would be the UITabViewController. -@property(nonatomic, assign) UIViewController *rootViewController; +/// Required reference to the current root view controller. For example the root view controller in +/// tab-based application would be the UITabViewController. +@property(nonatomic, weak) UIViewController *rootViewController; -// Required to set this banner view to a proper size. Never create your own -// GADAdSize directly. Use one of the predefined standard ad sizes -// (such as kGADAdSizeBanner), or create one using the GADAdSizeFromCGSize -// method. If not using mediation, then changing the adSize after an ad has -// been shown will cause a new request (for an ad of the new size) to be sent. -// If using mediation, then a new request may not be sent. +/// Required to set this banner view to a proper size. Never create your own GADAdSize directly. Use +/// one of the predefined standard ad sizes (such as kGADAdSizeBanner), or create one using the +/// GADAdSizeFromCGSize method. If not using mediation, then changing the adSize after an ad has +/// been shown will cause a new request (for an ad of the new size) to be sent. If using mediation, +/// then a new request may not be sent. @property(nonatomic, assign) GADAdSize adSize; -// Optional delegate object that receives state change notifications from this -// GADBannerView. Typically this is a UIViewController, however, if you are -// unfamiliar with the delegate pattern it is recommended you subclass this -// GADBannerView and make it the delegate. That avoids any chance of your -// application crashing if you forget to nil out the delegate. For example: -// -// @interface MyAdView : GADBannerView -// @end -// -// @implementation MyAdView -// - (id)initWithFrame:(CGRect)frame { -// if ((self = [super initWithFrame:frame])) { -// self.delegate = self; -// } -// return self; -// } -// -// - (void)dealloc { -// self.delegate = nil; -// [super dealloc]; -// } -// -// @end -// -@property(nonatomic, assign) NSObject *delegate; +/// Optional delegate object that receives state change notifications from this GADBannerView. +/// Typically this is a UIViewController, however, if you are unfamiliar with the delegate pattern +/// it is recommended you subclass this GADBannerView and make it the delegate. That avoids any +/// chance of your application crashing if you forget to nil out the delegate. For example: +/// +/// \code +/// @interface MyAdView : GADBannerView +/// @end +/// +/// @implementation MyAdView +/// - (id)initWithFrame:(CGRect)frame { +/// self = [super initWithFrame:frame]; +/// if (self) { +/// self.delegate = self; +/// } +/// return self; +/// } +/// +/// - (void)dealloc { +/// self.delegate = nil; +/// [super dealloc]; +/// } +/// +/// @end +/// \endcode +@property(nonatomic, weak) NSObject *delegate; + +/// Optional delegate object that receives In-App Purchase (IAP) notifications from this +/// GADBannerView. Remember to nil the delegate before deallocating this object. +@property(nonatomic, weak) id inAppPurchaseDelegate; #pragma mark Making an Ad Request -// Makes an ad request. Additional targeting options can be supplied with a -// request object. Refresh the ad by calling this method again. +/// Makes an ad request. Additional targeting options can be supplied with a request object. Refresh +/// the ad by calling this method again. - (void)loadRequest:(GADRequest *)request; #pragma mark Ad Request -// YES, if the currently displayed ad (or most recent failure) was a result of -// auto refreshing as specified on server. This will be set to NO after each -// loadRequest: method. -@property(nonatomic, readonly) BOOL hasAutoRefreshed; +/// Indicates if the currently displayed ad (or most recent failure) was a result of auto refreshing +/// as specified on server. This property is set to NO after each loadRequest: method. +@property(nonatomic, readonly, assign) BOOL hasAutoRefreshed; #pragma mark Mediation -// Gets the underlying ad view of the mediated ad network. -// You may use this to find out the actual size of the ad and adjust -// GADBannerView to fit the underlying ad view. -@property(nonatomic, readonly) UIView *mediatedAdView; +/// The underlying ad view of the mediated ad network. You may use this to find out the actual +/// size of the ad and adjust GADBannerView to fit the underlying ad view. +@property(nonatomic, readonly, weak) UIView *mediatedAdView; -// Returns the ad network class name that fetched the current ad. Returns nil while the latest ad -// request is in progress or if the latest ad request failed. For both standard and mediated Google -// AdMob ads, this method returns @"GADMAdapterGoogleAdMobAds". For ads fetched via mediation custom -// events, this method returns @"GADMAdapterCustomEvents". -@property(nonatomic, readonly) NSString *adNetworkClassName; +/// The ad network class name that fetched the current ad. Returns nil while the latest ad request +/// is in progress or if the latest ad request failed. For both standard and mediated Google AdMob +/// ads, this method returns @"GADMAdapterGoogleAdMobAds". For ads fetched via mediation custom +/// events, this method returns @"GADMAdapterCustomEvents". +@property(nonatomic, readonly, weak) NSString *adNetworkClassName; @end diff --git a/mediation/mediatedviews/libs/AdMob/GADBannerViewDelegate.h b/mediation/mediatedviews/libs/AdMob/GADBannerViewDelegate.h index 4779683f4..9f80dc233 100644 --- a/mediation/mediatedviews/libs/AdMob/GADBannerViewDelegate.h +++ b/mediation/mediatedviews/libs/AdMob/GADBannerViewDelegate.h @@ -7,54 +7,53 @@ #import +#import "GADModules.h" + @class GADRequestError; @class GADBannerView; -// Delegate for receiving state change messages from a GADBannerView such as ad -// requests succeeding/failing or when an ad has been clicked. +/// Delegate for receiving state change messages from a GADBannerView such as ad requests +/// succeeding/failing or when an ad has been clicked. @protocol GADBannerViewDelegate @optional #pragma mark Ad Request Lifecycle Notifications -// Sent when an ad request loaded an ad. This is a good opportunity to add this -// view to the hierarchy if it has not yet been added. If the ad was received -// as a part of the server-side auto refreshing, you can examine the -// hasAutoRefreshed property of the view. +/// Called when an ad request loaded an ad. This is a good opportunity to add this view to the +/// hierarchy if it has not been added yet. If the ad was received as a part of the server-side auto +/// refreshing, you can examine the hasAutoRefreshed property of the view. - (void)adViewDidReceiveAd:(GADBannerView *)view; -// Sent when an ad request failed. Normally this is because no network -// connection was available or no ads were available (i.e. no fill). If the -// error was received as a part of the server-side auto refreshing, you can -// examine the hasAutoRefreshed property of the view. +/// Called when an ad request failed. Normally this is because no network connection was available +/// or no ads were available (i.e. no fill). If the error was received as a part of the server-side +/// auto refreshing, you can examine the hasAutoRefreshed property of the view. - (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestError *)error; #pragma mark Click-Time Lifecycle Notifications -// Sent just before presenting the user a full screen view, such as a browser, -// in response to clicking on an ad. Use this opportunity to stop animations, -// time sensitive interactions, etc. -// -// Normally the user looks at the ad, dismisses it, and control returns to your -// application by calling adViewDidDismissScreen:. However if the user hits the -// Home button or clicks on an App Store link your application will end. On iOS -// 4.0+ the next method called will be applicationWillResignActive: of your -// UIViewController (UIApplicationWillResignActiveNotification). Immediately -// after that adViewWillLeaveApplication: is called. +/// Called just before presenting the user a full screen view, such as a browser, in response to +/// clicking on an ad. Use this opportunity to stop animations, time sensitive interactions, etc. +/// +/// Normally the user looks at the ad, dismisses it, and control returns to your application by +/// calling adViewDidDismissScreen:. However if the user hits the Home button or clicks on an App +/// Store link your application will end. On iOS 4.0+ the next method called will be +/// applicationWillResignActive: of your UIViewController +/// (UIApplicationWillResignActiveNotification). Immediately after that adViewWillLeaveApplication: +/// is called. - (void)adViewWillPresentScreen:(GADBannerView *)adView; -// Sent just before dismissing a full screen view. +/// Called just before dismissing a full screen view. - (void)adViewWillDismissScreen:(GADBannerView *)adView; -// Sent just after dismissing a full screen view. Use this opportunity to -// restart anything you may have stopped as part of adViewWillPresentScreen:. +/// Called just after dismissing a full screen view. Use this opportunity to restart anything you +/// may have stopped as part of adViewWillPresentScreen:. - (void)adViewDidDismissScreen:(GADBannerView *)adView; -// Sent just before the application will background or terminate because the -// user clicked on an ad that will launch another application (such as the App -// Store). The normal UIApplicationDelegate methods, like -// applicationDidEnterBackground:, will be called immediately before this. +/// Called just before the application will background or terminate because the user clicked on an +/// ad that will launch another application (such as the App Store). The normal +/// UIApplicationDelegate methods, like applicationDidEnterBackground:, will be called immediately +/// before this. - (void)adViewWillLeaveApplication:(GADBannerView *)adView; @end diff --git a/mediation/mediatedviews/libs/AdMob/GADInAppPurchase.h b/mediation/mediatedviews/libs/AdMob/GADInAppPurchase.h new file mode 100644 index 000000000..5951601b3 --- /dev/null +++ b/mediation/mediatedviews/libs/AdMob/GADInAppPurchase.h @@ -0,0 +1,38 @@ +// +// GADInAppPurchase.h +// Google Mobile Ads SDK +// +// Copyright 2013 Google Inc. All rights reserved. +// + +#import + +#import "GADModules.h" + +/// Enum of the different statuses resulting from processing a purchase. +typedef NS_ENUM(NSInteger, GADInAppPurchaseStatus) { + kGADInAppPurchaseStatusError = 0, ///< Error occured while processing the purchase. + kGADInAppPurchaseStatusSuccessful = 1, ///< Purchase was completed successfully. + kGADInAppPurchaseStatusCancel = 2, ///< Purchase was cancelled by the user. + kGADInAppPurchaseStatusInvalidProduct = 3 ///< Error occured while looking up the product. +}; + +/// The in-app purchase item to be purchased with the purchase flow handled by you, the +/// application developer. +/// Instances of this class are created and passed to your in-app purchase delegate when users click +/// a buy button. It is important to report the result of the purchase back to the SDK in order to +/// track metrics about the transaction. +@interface GADInAppPurchase : NSObject + +/// The in-app purchase product ID. +@property(nonatomic, readonly, copy) NSString *productID; + +/// The product quantity. +@property(nonatomic, readonly, assign) NSUInteger quantity; + +/// The in-app purchase delegate object must call this method after handling the in-app purchase for +/// both successful and unsuccessful purchase attempts. This method reports ad conversion and +/// purchase status information to Google. +- (void)reportPurchaseStatus:(GADInAppPurchaseStatus)purchaseStatus; + +@end diff --git a/mediation/mediatedviews/libs/AdMob/GADInAppPurchaseDelegate.h b/mediation/mediatedviews/libs/AdMob/GADInAppPurchaseDelegate.h new file mode 100644 index 000000000..10ddcc9d7 --- /dev/null +++ b/mediation/mediatedviews/libs/AdMob/GADInAppPurchaseDelegate.h @@ -0,0 +1,21 @@ +// +// GADInAppPurchaseDelegate.h +// Google AdMob Ads SDK +// +// Copyright 2013 Google Inc. All rights reserved. +// + +#import + +#import "GADModules.h" + +@class GADInAppPurchase; + +/// In-app purchase (IAP) delegate protocol. +@protocol GADInAppPurchaseDelegate + +/// Called when the user clicks on the buy button of an IAP ad. After the receiver handles the +/// purchase, it must call the purchase object's reportPurchaseStatus: method. +- (void)didReceiveInAppPurchase:(GADInAppPurchase *)purchase; + +@end diff --git a/mediation/mediatedviews/libs/AdMob/GADInterstitial.h b/mediation/mediatedviews/libs/AdMob/GADInterstitial.h index c0ab4f7b5..20dffb78e 100644 --- a/mediation/mediatedviews/libs/AdMob/GADInterstitial.h +++ b/mediation/mediatedviews/libs/AdMob/GADInterstitial.h @@ -7,80 +7,80 @@ #import +#import "GADInAppPurchaseDelegate.h" #import "GADInterstitialDelegate.h" +#import "GADModules.h" #import "GADRequest.h" #import "GADRequestError.h" -// An interstitial ad. This is a full-screen advertisement shown at natural -// transition points in your application such as between game levels or news -// stories. -// -// Interstitials are shown sparingly. Expect low to no fill. +/// An interstitial ad. This is a full-screen advertisement shown at natural transition points in +/// your application such as between game levels or news stories. +/// +/// Interstitials are shown sparingly. Expect low to no fill. @interface GADInterstitial : NSObject #pragma mark Pre-Request -// Required value created in the AdSense website. Create a new ad unit for -// every unique placement of an ad in your application. Set this to the ID -// assigned for this placement. Ad units are important for targeting and stats. -// Example values for different request types: -// AdMob: a0123456789ABCD -// DFP: /0123/ca-pub-0123456789012345/my-ad-identifier -// AdSense: ca-mb-app-pub-0123456789012345/my-ad-identifier +/// Required value created in the AdSense website. Create a new ad unit for every unique placement +/// of an ad in your application. Set this to the ID assigned for this placement. Ad units are +/// important for targeting and stats. +/// Example values for different request types: +/// AdMob: a0123456789ABCD +/// DFP: /0123/ca-pub-0123456789012345/my-ad-identifier +/// AdSense: ca-mb-app-pub-0123456789012345/my-ad-identifier @property(nonatomic, copy) NSString *adUnitID; -// Optional delegate object that receives state change notifications from this -// GADInterstitalAd. Remember to nil the delegate before deallocating this -// object. -@property(nonatomic, assign) NSObject *delegate; +/// Optional delegate object that receives state change notifications from this GADInterstitalAd. +/// Remember to nil the delegate before deallocating this object. +@property(nonatomic, weak) id delegate; + +/// Optional delegate object that receives In-App Purchase (IAP) notifications from this +/// GADInterstital ad. Remember to nil the delegate before deallocating this object. +@property(nonatomic, weak) id inAppPurchaseDelegate; #pragma mark Making an Ad Request -// Makes an interstitial ad request. Additional targeting options can be -// supplied with a request object. Only one interstitial request is allowed at -// a time. -// -// This is best to do several seconds before the interstitial is needed to -// preload its content. Then when transitioning between view controllers show -// the interstital with presentFromViewController. +/// Makes an interstitial ad request. Additional targeting options can be supplied with a request +/// object. Only one interstitial request is allowed at a time. +/// +/// This is best to do several seconds before the interstitial is needed to preload its content. +/// Then when transitioning between view controllers show the interstital with +/// presentFromViewController. - (void)loadRequest:(GADRequest *)request; #pragma mark Request at Application Launch -// The |window| will be shown with the |image| displayed until either the -// |request| interstitial is shown or a timeout occurs. The delegate will -// receive an interstitialDidDismissScreen: callback to indicate that your app -// should continue when the interstitial has finished. +/// The |window| will be shown with the |image| displayed until either the |request| interstitial is +/// shown or a timeout occurs. The delegate will receive an interstitialDidDismissScreen: callback +/// to indicate that your app should continue when the interstitial has finished. - (void)loadAndDisplayRequest:(GADRequest *)request usingWindow:(UIWindow *)window initialImage:(UIImage *)image; #pragma mark Post-Request -// Returns YES if the interstitial is ready to be displayed. The delegate's -// interstitialAdDidReceiveAd: will be called when this switches from NO to YES. +/// Returns YES if the interstitial is ready to be displayed. The delegate's +/// interstitialAdDidReceiveAd: will be called when this switches from NO to YES. @property(nonatomic, readonly, assign) BOOL isReady; -// Returns YES if the interstitial object has already shown an interstitial. -// Note that an interstitial object can only be used once even with different -// requests. +/// Returns YES if the interstitial object has already shown an interstitial. Note that an +/// interstitial object can only be used once even with different requests. @property(nonatomic, readonly, assign) BOOL hasBeenUsed; -// Returns the ad network class name that fetched the current ad. Returns nil while the latest ad -// request is in progress or if the latest ad request failed. For both standard and mediated Google -// AdMob ads, this method returns @"GADMAdapterGoogleAdMobAds". For ads fetched via mediation custom -// events, this method returns @"GADMAdapterCustomEvents". -@property(nonatomic, readonly) NSString *adNetworkClassName; - -// Presents the interstitial ad which takes over the entire screen until the -// user dismisses it. This has no effect unless isReady returns YES and/or the -// delegate's interstitialDidReceiveAd: has been received. -// -// Set rootViewController to the current view controller at the time this method -// is called. If your application does not use view controllers pass in nil and -// your views will be removed from the window to show the interstitial and -// restored when done. After the interstitial has been removed, the delegate's -// interstitialDidDismissScreen: will be called. +/// Returns the ad network class name that fetched the current ad. Returns nil while the latest ad +/// request is in progress or if the latest ad request failed. For both standard and mediated Google +/// AdMob ads, this method returns @"GADMAdapterGoogleAdMobAds". For ads fetched via mediation +/// custom events, this method returns @"GADMAdapterCustomEvents". +@property(nonatomic, readonly, copy) NSString *adNetworkClassName; + +/// Presents the interstitial ad which takes over the entire screen until the user dismisses it. +/// This has no effect unless isReady returns YES and/or the delegate's interstitialDidReceiveAd: +/// has been received. +/// +/// Set rootViewController to the current view controller at the time this method is called. If your +/// application does not use view controllers pass in nil and your views will be removed from the +/// window to show the interstitial and restored when done. After the interstitial has been removed, +/// the delegate's interstitialDidDismissScreen: will be called. - (void)presentFromRootViewController:(UIViewController *)rootViewController; @end diff --git a/mediation/mediatedviews/libs/AdMob/GADInterstitialDelegate.h b/mediation/mediatedviews/libs/AdMob/GADInterstitialDelegate.h index 79c4f5f75..ddde90b73 100644 --- a/mediation/mediatedviews/libs/AdMob/GADInterstitialDelegate.h +++ b/mediation/mediatedviews/libs/AdMob/GADInterstitialDelegate.h @@ -7,46 +7,45 @@ #import +#import "GADModules.h" + @class GADInterstitial; @class GADRequestError; -// Delegate for receiving state change messages from a GADInterstitial such as -// interstitial ad requests succeeding/failing. +/// Delegate for receiving state change messages from a GADInterstitial such as interstitial ad +/// requests succeeding/failing. @protocol GADInterstitialDelegate @optional #pragma mark Ad Request Lifecycle Notifications -// Sent when an interstitial ad request succeeded. Show it at the next -// transition point in your application such as when transitioning between view -// controllers. +/// Called when an interstitial ad request succeeded. Show it at the next transition point in your +/// application such as when transitioning between view controllers. - (void)interstitialDidReceiveAd:(GADInterstitial *)ad; -// Sent when an interstitial ad request completed without an interstitial to -// show. This is common since interstitials are shown sparingly to users. +/// Called when an interstitial ad request completed without an interstitial to +/// show. This is common since interstitials are shown sparingly to users. - (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADRequestError *)error; #pragma mark Display-Time Lifecycle Notifications -// Sent just before presenting an interstitial. After this method finishes the -// interstitial will animate onto the screen. Use this opportunity to stop -// animations and save the state of your application in case the user leaves -// while the interstitial is on screen (e.g. to visit the App Store from a link -// on the interstitial). +/// Called just before presenting an interstitial. After this method finishes the interstitial will +/// animate onto the screen. Use this opportunity to stop animations and save the state of your +/// application in case the user leaves while the interstitial is on screen (e.g. to visit the App +/// Store from a link on the interstitial). - (void)interstitialWillPresentScreen:(GADInterstitial *)ad; -// Sent before the interstitial is to be animated off the screen. +/// Called before the interstitial is to be animated off the screen. - (void)interstitialWillDismissScreen:(GADInterstitial *)ad; -// Sent just after dismissing an interstitial and it has animated off the -// screen. +/// Called just after dismissing an interstitial and it has animated off the screen. - (void)interstitialDidDismissScreen:(GADInterstitial *)ad; -// Sent just before the application will background or terminate because the -// user clicked on an ad that will launch another application (such as the App -// Store). The normal UIApplicationDelegate methods, like -// applicationDidEnterBackground:, will be called immediately before this. +/// Called just before the application will background or terminate because the user clicked on an +/// ad that will launch another application (such as the App Store). The normal +/// UIApplicationDelegate methods, like applicationDidEnterBackground:, will be called immediately +/// before this. - (void)interstitialWillLeaveApplication:(GADInterstitial *)ad; @end diff --git a/mediation/mediatedviews/libs/AdMob/GADModules.h b/mediation/mediatedviews/libs/AdMob/GADModules.h new file mode 100644 index 000000000..f25b06820 --- /dev/null +++ b/mediation/mediatedviews/libs/AdMob/GADModules.h @@ -0,0 +1,15 @@ +// If your target uses modules, importing this file will automatically link the frameworks used by +// the Google Mobile Ads library. + +#if __has_feature(objc_modules) +@import AdSupport; +@import AudioToolbox; +@import AVFoundation; +@import CoreGraphics; +@import CoreTelephony; +@import Foundation; +@import MessageUI; +@import StoreKit; +@import SystemConfiguration; +@import UIKit; +#endif diff --git a/mediation/mediatedviews/libs/AdMob/GADRequest.h b/mediation/mediatedviews/libs/AdMob/GADRequest.h index f1f9e1c84..54cd5ea35 100644 --- a/mediation/mediatedviews/libs/AdMob/GADRequest.h +++ b/mediation/mediatedviews/libs/AdMob/GADRequest.h @@ -8,123 +8,115 @@ #import #import +#import "GADModules.h" + @protocol GADAdNetworkExtras; -// Constant for getting test ads on the simulator using the testDevices method. +/// Constant for getting test ads on the simulator using the testDevices method. #define GAD_SIMULATOR_ID @"Simulator" -// Genders to help deliver more relevant ads. +/// Genders to help deliver more relevant ads. typedef NS_ENUM(NSInteger, GADGender) { kGADGenderUnknown, ///< Unknown gender. kGADGenderMale, ///< Male gender. kGADGenderFemale ///< Female gender. }; -// Specifies optional parameters for ad requests. +/// Specifies optional parameters for ad requests. @interface GADRequest : NSObject -// Creates an autoreleased GADRequest. +/// Creates an autoreleased GADRequest. + (GADRequest *)request; #pragma mark Additional Parameters For Ad Networks -// Ad networks may have additional parameters they accept. To pass these -// parameters to them, create the ad network extras object for that network, -// fill in the parameters, and register it here. The ad network should have a -// header defining the interface for the 'extras' object to create. All -// networks will have access to the basic settings you've set in this GADRequest -// (gender, birthday, testing mode, etc.). If you register an extras object -// that is the same class as one you have registered before, the previous -// extras will be overwritten. +/// Ad networks may have additional parameters they accept. To pass these parameters to them, create +/// the ad network extras object for that network, fill in the parameters, and register it here. The +/// ad network should have a header defining the interface for the 'extras' object to create. All +/// networks will have access to the basic settings you've set in this GADRequest (gender, birthday, +/// testing mode, etc.). If you register an extras object that is the same class as one you have +/// registered before, the previous extras will be overwritten. - (void)registerAdNetworkExtras:(id)extras; -// Get the network extras defined for an ad network. -- (id)adNetworkExtrasFor:(Class)clazz; +/// Get the network extras defined for an ad network. +- (id)adNetworkExtrasFor:(Class)aClass; -// Unsets the extras for an ad network. |clazz| is the class which represents -// that network's extras type. -- (void)removeAdNetworkExtrasFor:(Class)clazz; +/// Unsets the extras for an ad network. |clazz| is the class which represents that network's extras +/// type. +- (void)removeAdNetworkExtrasFor:(Class)aClass; -// Extras sent to the mediation server (if using Mediation). For future use. +/// Extras sent to the mediation server (if using Mediation). For future use. @property(nonatomic, copy) NSDictionary *mediationExtras; #pragma mark Collecting SDK Information -// Returns the version of the SDK. +/// Returns the version of the SDK. + (NSString *)sdkVersion; #pragma mark Testing -// Add the device's identifier into this array for testing purposes. +/// Add the device's identifier into this array for testing purposes. @property(nonatomic, copy) NSArray *testDevices; #pragma mark User Information -// The user's gender may be used to deliver more relevant ads. +/// The user's gender may be used to deliver more relevant ads. @property(nonatomic, assign) GADGender gender; -// The user's birthday may be used to deliver more relevant ads. -@property(nonatomic, retain) NSDate *birthday; +/// The user's birthday may be used to deliver more relevant ads. +@property(nonatomic, strong) NSDate *birthday; - (void)setBirthdayWithMonth:(NSInteger)m day:(NSInteger)d year:(NSInteger)y; -// The user's current location may be used to deliver more relevant ads. -// However do not use Core Location just for advertising, make sure it is used -// for more beneficial reasons as well. It is both a good idea and part of -// Apple's guidelines. +/// The user's current location may be used to deliver more relevant ads. However do not use Core +/// Location just for advertising, make sure it is used for more beneficial reasons as well. It is +/// both a good idea and part of Apple's guidelines. - (void)setLocationWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude accuracy:(CGFloat)accuracyInMeters; -// When Core Location isn't available but the user's location is known supplying -// it here may deliver more relevant ads. It can be any free-form text such as -// @"Champs-Elysees Paris" or @"94041 US". +/// When Core Location isn't available but the user's location is known supplying it here may +/// deliver more relevant ads. It can be any free-form text such as @"Champs-Elysees Paris" or +/// @"94041 US". - (void)setLocationWithDescription:(NSString *)locationDescription; -// [Optional] This method allows you to specify whether you would like your app -// to be treated as child-directed for purposes of the Children’s Online Privacy -// Protection Act (COPPA) - -// http://business.ftc.gov/privacy-and-security/childrens-privacy. -// -// If you call this method with YES, you are indicating that your app should be -// treated as child-directed for purposes of the Children’s Online Privacy -// Protection Act (COPPA). -// If you call this method with NO, you are indicating that your app should not -// be treated as child-directed for purposes of the Children’s Online Privacy -// Protection Act (COPPA). -// If you do not call this method, ad requests will include no indication of how -// you would like your app treated with respect to COPPA. -// -// By setting this method, you certify that this notification is accurate and -// you are authorized to act on behalf of the owner of the app. You understand -// that abuse of this setting may result in termination of your Google account. -// -// Note: it may take some time for this designation to be fully implemented in -// applicable Google services. -// This designation will only apply to ad requests for which you have set this -// method. +/// [Optional] This method allows you to specify whether you would like your app to be treated as +/// child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA), +/// http:///business.ftc.gov/privacy-and-security/childrens-privacy. +/// +/// If you call this method with YES, you are indicating that your app should be treated as +/// child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA). If you call +/// this method with NO, you are indicating that your app should not be treated as child-directed +/// for purposes of the Children’s Online Privacy Protection Act (COPPA). If you do not call this +/// method, ad requests will include no indication of how you would like your app treated with +/// respect to COPPA. +/// +/// By setting this method, you certify that this notification is accurate and you are authorized to +/// act on behalf of the owner of the app. You understand that abuse of this setting may result in +/// termination of your Google account. +/// +/// It may take some time for this designation to be fully implemented in applicable Google +/// services. This designation will only apply to ad requests for which you have set this method. - (void)tagForChildDirectedTreatment:(BOOL)childDirectedTreatment; #pragma mark Contextual Information -// A keyword is a word or phrase describing the current activity of the user -// such as @"Sports Scores". Each keyword is an NSString in the NSArray. To -// clear the keywords set this to nil. -@property(nonatomic, retain) NSMutableArray *keywords; +/// A keyword is a word or phrase describing the current activity of the user such as @"Sports +/// Scores". Each keyword is an NSString in the NSArray. To clear the keywords set this to nil. +@property(nonatomic, strong) NSMutableArray *keywords; -// Convenience method for adding keywords one at a time such as @"Sports Scores" -// and then @"Football". +/// Convenience method for adding keywords one at a time such as @"Sports Scores" and then +/// @"Football". - (void)addKeyword:(NSString *)keyword; -#pragma mark - -#pragma mark Deprecated Methods +#pragma mark - Deprecated Methods -// Accesses the additionalParameters for the "GoogleAdmob" ad network. Please -// use -registerAdNetworkExtras: method above and pass an instance of -// GADAdMobExtras instead. -@property(nonatomic, copy) NSDictionary *additionalParameters; +/// Accesses the additionalParameters for the "GoogleAdmob" ad network. Please use +/// -registerAdNetworkExtras: method above and pass an instance of GADAdMobExtras instead. +@property(nonatomic, copy) NSDictionary *additionalParameters __attribute__(( + deprecated(" use registerAdNetworkExtras: and pass an instance of GADAdMobExtras."))); -// This property has been deprecated with the latest SDK releases. Please use -// testDevices. -@property(nonatomic, assign, getter=isTesting) BOOL testing; +/// This property has been deprecated with the latest SDK releases. Please use testDevices. +@property(nonatomic, assign, getter=isTesting) BOOL testing + __attribute__((deprecated(" use the testDevices property."))); @end diff --git a/mediation/mediatedviews/libs/AdMob/GADRequestError.h b/mediation/mediatedviews/libs/AdMob/GADRequestError.h index 58f3178dd..a5e0ab292 100644 --- a/mediation/mediatedviews/libs/AdMob/GADRequestError.h +++ b/mediation/mediatedviews/libs/AdMob/GADRequestError.h @@ -7,6 +7,8 @@ #import +#import "GADModules.h" + @class GADRequest; /// Google AdMob Ads error domain. @@ -14,8 +16,8 @@ extern NSString *const kGADErrorDomain; /// NSError codes for GAD error domain. typedef NS_ENUM(NSInteger, GADErrorCode) { - /// The ad request is invalid. The localizedFailureReason error description will have more - /// details. Typically this is because the ad did not have the ad unit ID or root view + /// The ad request is invalid. The localizedFailureReason error description will have more + /// details. Typically this is because the ad did not have the ad unit ID or root view /// controller set. kGADErrorInvalidRequest, @@ -50,6 +52,6 @@ typedef NS_ENUM(NSInteger, GADErrorCode) { kGADErrorMediationInvalidAdSize }; -/// This class represents the error generated due to invalid request parameters. +/// Represents the error generated due to invalid request parameters. @interface GADRequestError : NSError @end diff --git a/mediation/mediatedviews/libs/AdMob/README.txt b/mediation/mediatedviews/libs/AdMob/README.txt index bcd2340db..9897a6d92 100644 --- a/mediation/mediatedviews/libs/AdMob/README.txt +++ b/mediation/mediatedviews/libs/AdMob/README.txt @@ -6,8 +6,8 @@ This is the Google AdMob Ads SDK for iOS. Requirements: - An AdMob site ID or DoubleClick for Publishers account. -- Xcode 4.5 or later. -- Runtime of iOS 4.3 or later. +- Xcode 5.1 or later. +- Runtime of iOS 5.0 or later. The latest documentation and code samples are available at: https://developers.google.com/mobile-ads-sdk/docs/ diff --git a/mediation/mediatedviews/libs/AdMob/libGoogleAdMobAds.a b/mediation/mediatedviews/libs/AdMob/libGoogleAdMobAds.a index 34226991d..3d6959296 100644 Binary files a/mediation/mediatedviews/libs/AdMob/libGoogleAdMobAds.a and b/mediation/mediatedviews/libs/AdMob/libGoogleAdMobAds.a differ diff --git a/mediation/mediatedviews/libs/MMSDK/LICENSE b/mediation/mediatedviews/libs/MMSDK/LICENSE new file mode 100644 index 000000000..ec638e457 --- /dev/null +++ b/mediation/mediatedviews/libs/MMSDK/LICENSE @@ -0,0 +1,76 @@ +AppNexus iOS Mobile Advertising SDK (the "AppNexus SDK") +Copyright 2013 to 2014 AppNexus Inc. All rights reserved. + +The AppNexus SDK is licensed under the terms of the Apache License Version 2.0, as set forth in its entirety in the License file accompanying the AppNexus SDK. + + +All content located in the MillennialMedia.framework folder in the AppNexus SDK (all such content, the "Millennial SDK" or "SDK") was developed by Millennial Media Inc. and the use of which is subject to the Millennial Mobile Application SDK License Agreement set forth below: + + +MOBILE APPLICATION SDK LICENSE AGREEMENT PLEASE READ THIS CAREFULLY. IF YOU DO NOT AGREE TO THESE TERMS, YOU ARE NOT AUTHORIZED TO DOWNLOAD OR USE THIS SDK. + +THIS MOBILE APPLICATION SDK LICENSE AGREEMENT (THIS "AGREEMENT") IS A LEGAL AGREEMENT BETWEEN MILLENNIAL MEDIA, INC. ("MILLENNIAL MEDIA" OR "WE") AND YOU INDIVIDUALLY IF YOU ARE AGREEING TO IT IN YOUR PERSONAL CAPACITY, OR IF YOU ARE AUTHORIZED TO DOWNLOAD THE SDK ON BEHALF OF YOUR COMPANY OR ORGANIZATION, BETWEEN THE ENTITY FOR WHOSE BENEFIT YOU ACT ("YOU"). MILLENNIAL MEDIA OWNS AND OPERATES THE MMEDIA WEBSITE (THE "SITE") AND THE MMEDIA MOBILE PLATFORM SERVICE (THE "SERVICE"). + + +BY DOWNLOADING, INSTALLING, ACTIVATING OR USING THE SDK, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS AGREEMENT. IF YOU HAVE ANY QUESTIONS OR CONCERNS ABOUT THE TERMS OF THIS AGREEMENT, PLEASE CONTACT US AT DEVELOPER@MILLENNIALMEDIA.COM. + + +This Agreement governs your access to, and use of, (a) the object code version of the provided software and associated application programming interface for use with mobile applications, as well as any related materials, including installation tools, sample code, source code, software libraries and documentation and any error corrections, updates, or new releases that we elect, in our sole discretion, to make available to you (all such materials, collectively, the "SDK") and (b) the Site and Service. You acknowledge that the SDK may include third party software and may enable services provided by third parties. + +1. License. Subject to the terms and conditions of this Agreement, Millennial Media hereby grants you a non-exclusive, non-transferable, non-sublicenseable, royalty-free right and license to copy and use the SDK solely for the purpose of performance pursuant to your mobile advertising agreement with Millennial Media, in accordance with the documentation (the "Purpose"). You acknowledge and agree that you have no rights to any upgrades, modifications, enhancements or revisions that Millennial Media may make to the SDK. You agree that we have no obligation to provide any support or engineering assistance of any sort unless we otherwise agree in writing. You acknowledge that we and our suppliers retain all right, title and interest in and to the original, and any copies, of the SDK and to the services enabled by the SDK. + +2. Restrictions. You may not use the SDK to: (i) design or develop anything other than a mobile application consistent with the Purpose; (ii) make any more copies of the SDK than are reasonably necessary for your authorized use thereof; (iii) modify, create derivative works of, reverse engineer, reverse compile, or disassemble the SDK or any portion thereof; (iv) distribute, publish, sell, transfer, assign, lease, rent, lend, or sublicense either in whole or part the SDK to any third party except as may specifically be permitted in Section 3 herein; (v) redistribute any component of the SDK except as set forth in Section 3 herein, or (vi) remove or otherwise obfuscate any proprietary notices or labels from the SDK. You may not use the SDK except in accordance with applicable laws and regulations, nor may you export the SDK from and outside the United States of America except as permitted under the applicable laws and regulations of the United Sates of America. You may not use the SDK to defraud any third party or to distribute obscene or other unlawful materials or information. + +You may not use any of the services enabled by the SDK, or enable use of such services, to: (a) submit any automated or recorded requests unless otherwise approved in writing by Millennial Media and its suppliers; (b) be used for commercial purposes; (c) access such services with software or means other than as specified in the SDK; (d) copy, reproduce, distribute, or in any other manner duplicate such services, in whole or in part; (e) sell, lease, license, sublicense, distribute, assign, transfer or otherwise grant any rights in the SDK, in whole or in part; (f) modify, port, translate, or create derivative works of the SDK or such services; (g) decompile, disassemble, reverse engineer or otherwise attempt to derive, reconstruct, identify or discover any source code, underlying ideas, or algorithms, of the SDK or such services by any means; (h) be used for purposes of comparison with or benchmarking against products or services made available by third parties; or (i) cause any part of the SDK to be placed in the public domain. + +Third-party trademarks, trade names, product names and logos (the "Trademarks") contained in or used by the SDK or services enabled by the SDK are the trademarks or registered trademarks of their respective owners, and the use of such Trademarks shall inure to the benefit of the trademark owner. The use of such Trademarks is intended to denote interoperability and does not constitute: (i) an affiliation by Millennial Media and its suppliers with the user of the Trademarks, or (ii) an endorsement or approval by Company and its suppliers. + +3. End Users and Mediators. You may distribute those components of the SDK that are expressly identified in the documentation as intended for distribution, solely as integrated in your application. If any component of the SDK is distributed with your application, then you will ensure that any end-user obtaining access to such application will be subject to an end-user license agreement containing terms at least as protective of Millennial Media and the SDK as the terms set forth in this Agreement. + +If Millennial Media has authorized you (in writing) to distribute the SDK to others (i.e., you are a "mediator"): (a) you may distribute the SDK, solely as incorporated into your software development kit that you distribute to developers, and (b) you will ensure that any person to whom it is distributed is subject to a license agreement containing terms at least as protective of Millennial Media and the SDK as the terms set forth in this Agreement (including the requirements in this Section 3). + +4. Copyright Notice. You must include all copyright and other proprietary rights notices that accompany the SDK in any copies that you produce. + +5. Proprietary Rights. Subject always to our ownership of the SDK, you will be the sole and exclusive owner of any software application developed using the SDK, excluding the SDK and any portions thereof. + +6. Feedback. In the event that you provide us any ideas, thoughts, criticisms, suggested improvements or other feedback related to the Site or the Services, (collectively "Feedback"), you agree we may use the Feedback to modify our products and services and that you will not be due any compensation, including any royalty related to the product or service that incorporates your Feedback. You grant to us a worldwide, royalty-free, fully paid, perpetual, irrevocable license to use, reproduce, modify, translate, distribute, perform, display, import, sell, offer for sale, make, have made and otherwise exploit the Feedback in any form, media, or technology, whether now known or hereafter developed, and to allow others to do the same. + +7. General Rules of Conduct. You agree not to use the SDK in a manner that: (a) Conducts or promotes any illegal activities; +(b) Uploads, distributes, posts, transmits or otherwise makes available, content or information that is unlawful, harmful, threatening, abusive, harassing, defamatory, vulgar, obscene, libelous, invasive of another's privacy, hateful, harmful to minors in any way, or racially, ethnically or otherwise objectionable; + +(c) Uses the SDK in any manner which interferes with the performance or functionality of the APIs or the Millennial Media services; (d) Loads or transmits any form of virus, worm, Trojan horse, or other malicious code; +(e) Promotes or advertises any item, good or service that (i) violates any applicable federal, state, or local law or regulation, or (ii) violates the terms of service of any website upon which the content is viewed; (f) Uses the SDK to generate unsolicited email advertisements or spam; or +(g) Uses any automatic, electronic or manual process to access, search or harvest information from an individual. + +8. Ownership. You understand and acknowledge that the software, code, proprietary methods and systems that make up the SDK are: (i) copyrighted by us and/or our licensors under United States and international copyright laws; (ii) subject to other intellectual property and proprietary rights and laws; and (iii) owned by us or our licensors. You must abide by all copyright notices, information, or restrictions contained in or attached to the SDK. If you are a U.S. Government end user, any of the components that constitute the SDK and its related documentation is a "commercial item" as that term is defined at 48 C.F.R. 2.101, consisting of "commercial computer software" and "commercial computer software documentation" as such terms are used in 48 C.F.R. 12.212. Consistent with 48 C.F.R. 12.212 and 48 C.F.R. +227.7202-1 through 227.7202-4, all U.S. Government end users acquire the SDK and any documentation provided with the SDK with only those rights set forth in this Agreement. + +9. Confidential Information. You will safeguard, protect, respect, and maintain as confidential the SDK, the underlying computer code to which you may obtain or receive access, and the functional or technical design, logic, or other internal routines or workings of the SDK, which are considered confidential and proprietary to Millennial Media. You agree not to reproduce, disseminate, sell, distribute or commercially exploit any such confidential information of Millennial Media in any manner. These non-disclosure obligations shall survive termination or expiration of this Agreement. + +10. Geographical Restrictions. We make no representation that all of the SDK is appropriate or available for use in locations outside the United States or all territories within the United States. If you choose to use the SDK, you do so on your own initiative and are responsible for compliance with local laws. + +11. Modification of the SDK. We reserve the right to modify or discontinue the SDK with or without notice to you. We will not be liable to you or any third party should we exercise our right to modify or discontinue the SDK. If you object to any such changes, your sole recourse will be to cease use of the SDK. YOU AGREE THAT WE WILL NOT BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY TERMINATION OF YOUR ACCESS TO THE SDK. + +12. Termination. You acknowledge and agree that we, at our sole discretion, may terminate your use of the SDK without prior notice for any reason at any time. You agree that we shall not be liable to You or any third party for termination of your access to the SDK. In the event of any termination, you will immediately cease use of the SDK. + +13. DISCLAIMERS. THE SDK AS WELL AS ALL SERVICES, SOFTWARE, MATERIALS, AND TECHNOLOGY PROVIDED IN CONNECTION WITH THIS AGREEMENT, ARE PROVIDED ON AN "AS IS" AND "AS AVAILABLE" BASIS WITHOUT ANY WARRANTY OF ANY KIND. TO THE MAXIMUM EXTENT PERMITTED BY LAW, MILLENNIAL MEDIA, OUR OFFICERS, DIRECTORS, AGENTS, SUPPLIERS, AND EMPLOYEES EXPRESSLY DISCLAIM ALL REPRESENTATIONS AND WARRANTIES, WHETHER EXPRESS OR IMPLIED, ORAL OR WRITTEN, INCLUDING ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, ACCURACY, TITLE, QUIET ENJOYMENT, UN-INTERRUPTION, AND/OR SYSTEM INTEGRATION. MILLENNIAL MEDIA, OUR OFFICERS, DIRECTORS, AGENTS, SUPPLIERS, AND EMPLOYEES MAKE NO WARRANTY ABOUT THE ACCURACY, RELIABILITY, COMPLETENESS, QUALITY, OR TIMELINESS OF THE SDK, OR THAT PROBLEMS WITH THE FOREGOING WILL BE CORRECTED, OR THAT THE SDK ARE FREE OF VIRUSES AND OTHER HARMFUL COMPONENTS, OR THAT THEY WILL BE UNINTERRUPTED OR ERROR FREE. + +14. LIMITATIONS OF LIABILITY AND CONTENT. YOU ACKNOWLEDGE AND AGREE THAT WE ARE ONLY WILLING TO PROVIDE ACCESS TO THE SDK IF YOU AGREE TO CERTAIN LIMITATIONS OF LIABILITY TO YOU AND TO THIRD PARTIES. IN NO EVENT WILL MILLENNIAL MEDIA, ITS PARENT, AFFILIATES, OFFICERS, DIRECTORS, AGENTS, SUPPLIERS OR EMPLOYEES BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY INDIRECT, INCIDENTAL, SPECIAL AND CONSEQUENTIAL DAMAGES OR LIKE DAMAGES, INCLUDING, LOST PROFITS, GOODWILL, LOST OPPORTUNITIES AND INTANGIBLE LOSSES, ARISING IN CONNECTION WITH THE SDK OR THESE TERMS, INCLUDING, FOR EXAMPLE AND CLARITY ONLY, DAMAGES RESULTING FROM LOST DATA, LOST EMPLOYMENT OPPORTUNITIES, OR BUSINESS INTERRUPTIONS, OR RESULTING FROM THE USE OR ACCESS TO, OR THE INABILITY TO USE OR TO USE THE SDK. THESE LIMITATIONS OF LIABILITY APPLY REGARDLESS OF THE NATURE OF ANY CLAIM, WHETHER BASED ON WARRANTY, CONTRACT, TORT, OR ANY OTHER LEGAL OR EQUITABLE THEORY, AND WHETHER OR NOT MILLENNIAL MEDIA IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +15. EXCLUSIVE REMEDY. YOU AGREE THAT YOUR SOLE AND EXCLUSIVE REMEDY FOR ANY CLAIMS ARISING IN CONNECTION WITH ANY VIOLATION BY US OF THIS AGREEMENT IS TO DISCONTINUE USING THE SDK. IN THE EVENT THAT A COURT DETERMINES THAT THE PRECEDING SENTENCE IS UNENFORCEABLE, OUR AGGREGATE LIABILITY FOR ALL CLAIMS ARISING IN CONNECTION WITH ANY VIOLATION OF THESE TERMS WILL NOT EXCEED ONE HUNDRED DOLLARS (U.S. $100.00). Some jurisdictions do not allow the exclusion of certain warranties or the limitation or exclusion of liability for certain types of damages. Accordingly, some of the above limitations and disclaimers may not apply to you. To the extent that we may not, as a matter of applicable law, disclaim any warranty or limit our liabilities, the scope and duration of such warranty and the extent of our liability will be the minimum permitted under such applicable law. + +16. FORCE MAJUERE. WITHOUT LIMITING THE FOREGOING, UNDER NO CIRCUMSTANCES WILL WE OR OUR SUPPLIERS BE HELD LIABLE FOR ANY DELAY OR FAILURE IN PERFORMANCE RESULTING DIRECTLY OR INDIRECTLY FROM ACTS OF NATURE, FORCES, OR CAUSES BEYOND OUR REASONABLE CONTROL, INCLUDING, WITHOUT LIMITATION, INTERNET FAILURES, COMPUTER EQUIPMENT FAILURES, TELECOMMUNICATION EQUIPMENT FAILURES, OTHER EQUIPMENT FAILURES, ELECTRICAL POWER FAILURES, STRIKES, LABOR DISPUTES, RIOTS, INSURRECTIONS, CIVIL DISTURBANCES, SHORTAGES OF LABOR OR MATERIALS, FIRES, FLOODS, STORMS, EXPLOSIONS, ACTS OF GOD, WAR, GOVERNMENTAL ACTIONS, ORDERS OF DOMESTIC OR FOREIGN COURTS OR TRIBUNALS, OR NON-PERFORMANCE OF THIRD PARTIES. + +17. Indemnification. You agree to indemnify, defend and hold harmless Millennial Media, our officers, directors, co-branders and other partners, employees, consultants and agents, from and against any and all third-party claims, liabilities, damages, losses, costs, expenses, + +fees (including reasonable attorneys' fees and court costs) that such parties may incur as a result of or arising from (i) any Content you submit, post or transmit through the SDK, (ii) your use of the SDK, (iii) your violation of this Agreement, (iv) your violation of any rights of any other person or entity, or (v) any viruses, trojan horses, worms, time bombs, cancelbots or other similar harmful or deleterious programming routines input by you into the SDK. + +18. Electronic Communications. For contractual purposes, you (i) consent to receive communications from us in an electronic form; and (ii) agree that all terms and conditions, agreements, notices, documents, disclosures, and other communications ("Communications") that we provide to you electronically satisfy any legal requirement that such Communications would satisfy if it were in a writing. Your consent to receive Communications and do business electronically, and our agreement to do so, applies to all of your interactions and transactions with us. The foregoing does not affect your non-waivable rights. You may withdraw your consent to receive Communications electronically by contacting us in the manner described below. If you withdraw your consent, from that time forward, you must stop using the SDK. The withdrawal of your consent will not affect the legal validity and enforceability of any obligations or any electronic Communications provided or business transacted between us prior to the time you withdraw your consent. Please keep us informed of any changes in your email or mailing address so that you continue to receive all Communications without interruption. + +19. General Terms. You are responsible for compliance with all applicable laws. This Agreement and the relationship between you and Millennial Media will be governed by the laws of the State of Maryland, without giving effect to any choice of laws principles that would require the application of the laws of a different country or state. Any legal action, suit or proceeding arising out of or relating to this Agreement, or your use of the SDK must be instituted exclusively in the federal or state courts located in Baltimore, Maryland and in no other jurisdiction. You further consent to exclusive personal jurisdiction and venue in, and agree to service of process issued or authorized by, any such court. This Agreement is personal to you, and you may not transfer, assign or delegate your right and/or duties under this Agreement to anyone else and any attempted assignment or delegation is void. You acknowledge that we have the right hereunder to seek an injunction, if necessary, to stop or prevent a breach of your obligations hereunder. The paragraph headings in this Agreement, shown in boldface type, are included only to help make this Agreement easier to read and have no binding effect. Any delay or failure by us to exercise or enforce any right or provision of this Agreement will not constitute a waiver of such right or provision. No waiver by us will have effect unless such waiver is set forth in writing, signed by us; nor will any such waiver of any breach or default constitute a waiver of any subsequent breach or default. This Agreement constitutes the complete and exclusive agreement between you and us with respect to the subject matter hereof, and supersedes all prior oral or written understandings, communications or agreements, other than your mobile advertising agreement with Millennial Media. If for any reason a court of competent jurisdiction finds any provision of this Agreement, or portion thereof, to be unenforceable, that provision of this Agreement will be enforced to the maximum extent permissible so as to effect the intent of the parties, and the remainder of this Agreement will continue in full force and effect. YOU AND MILLENNIAL MEDIA AGREE THAT ANY CAUSE OF ACTION ARISING OUT OF OR RELATED TO THE SITE, SERVICES OR MILLENNIAL MEDIA PLATFORM MUST COMMENCE WITHIN ONE (1) YEAR AFTER THE CAUSE OF ACTION ACCRUES, OTHERWISE, SUCH CAUSE OF ACTION IS PERMANENTLY BARRED. + + + + + + diff --git a/mediation/mediatedviews/libs/MMSDK/LICENSE.txt b/mediation/mediatedviews/libs/MMSDK/LICENSE.txt new file mode 100644 index 000000000..746f78e32 --- /dev/null +++ b/mediation/mediatedviews/libs/MMSDK/LICENSE.txt @@ -0,0 +1 @@ +MOBILE APPLICATION SDK LICENSE AGREEMENT PLEASE READ THIS CAREFULLY. IF YOU DO NOT AGREE TO THESE TERMS, YOU ARE NOT AUTHORIZED TO DOWNLOAD OR USE THIS SDK. THIS MOBILE APPLICATION SDK LICENSE AGREEMENT (THIS "AGREEMENT") IS A LEGAL AGREEMENT BETWEEN MILLENNIAL MEDIA, INC. (“MILLENNIAL MEDIA” OR “WE”) AND YOU INDIVIDUALLY IF YOU ARE AGREEING TO IT IN YOUR PERSONAL CAPACITY, OR IF YOU ARE AUTHORIZED TO DOWNLOAD THE SDK ON BEHALF OF YOUR COMPANY OR ORGANIZATION, BETWEEN THE ENTITY FOR WHOSE BENEFIT YOU ACT ("YOU"). MILLENNIAL MEDIA OWNS AND OPERATES THE MMEDIA WEBSITE (THE “SITE”) AND THE MMEDIA MOBILE PLATFORM SERVICE (THE “SERVICE”). BY DOWNLOADING, INSTALLING, ACTIVATING OR USING THE SDK, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS AGREEMENT. IF YOU HAVE ANY QUESTIONS OR CONCERNS ABOUT THE TERMS OF THIS AGREEMENT, PLEASE CONTACT US AT DEVELOPER@MILLENNIALMEDIA.COM. This Agreement governs your access to, and use of, (a) the object code version of the provided software and associated application programming interface for use with mobile applications, as well as any related materials, including installation tools, sample code, source code, software libraries and documentation and any error corrections, updates, or new releases that we elect, in our sole discretion, to make available to you (all such materials, collectively, the “SDK”) and (b) the Site and Service. You acknowledge that the SDK may include third party software and may enable services provided by third parties. 1. License. Subject to the terms and conditions of this Agreement, Millennial Media hereby grants you a non-exclusive, non-transferable, non-sublicenseable, royalty-free right and license to copy and use the SDK solely for the purpose of performance pursuant to your mobile advertising agreement with Millennial Media, in accordance with the documentation (the “Purpose”). You acknowledge and agree that you have no rights to any upgrades, modifications, enhancements or revisions that Millennial Media may make to the SDK. You agree that we have no obligation to provide any support or engineering assistance of any sort unless we otherwise agree in writing. You acknowledge that we and our suppliers retain all right, title and interest in and to the original, and any copies, of the SDK and to the services enabled by the SDK. 2. Restrictions. You may not use the SDK to: (i) design or develop anything other than a mobile application consistent with the Purpose; (ii) make any more copies of the SDK than are reasonably necessary for your authorized use thereof; (iii) modify, create derivative works of, reverse engineer, reverse compile, or disassemble the SDK or any portion thereof; (iv) distribute, publish, sell, transfer, assign, lease, rent, lend, or sublicense either in whole or part the SDK to any third party except as may specifically be permitted in Section 3 herein; (v) redistribute any component of the SDK except as set forth in Section 3 herein, or (vi) remove or otherwise obfuscate any proprietary notices or labels from the SDK. You may not use the SDK except in accordance with applicable laws and regulations, nor may you export the SDK from and outside the United States of America except as permitted under the applicable laws and regulations of the United Sates of America. You may not use the SDK to defraud any third party or to distribute obscene or other unlawful materials or information. You may not use any of the services enabled by the SDK, or enable use of such services, to: (a) submit any automated or recorded requests unless otherwise approved in writing by Millennial Media and its suppliers; (b) be used for commercial purposes; (c) access such services with software or means other than as specified in the SDK; (d) copy, reproduce, distribute, or in any other manner duplicate such services, in whole or in part; (e) sell, lease, license, sublicense, distribute, assign, transfer or otherwise grant any rights in the SDK, in whole or in part; (f) modify, port, translate, or create derivative works of the SDK or such services; (g) decompile, disassemble, reverse engineer or otherwise attempt to derive, reconstruct, identify or discover any source code, underlying ideas, or algorithms, of the SDK or such services by any means; (h) be used for purposes of comparison with or benchmarking against products or services made available by third parties; or (i) cause any part of the SDK to be placed in the public domain. Third-party trademarks, trade names, product names and logos (the “Trademarks”) contained in or used by the SDK or services enabled by the SDK are the trademarks or registered trademarks of their respective owners, and the use of such Trademarks shall inure to the benefit of the trademark owner. The use of such Trademarks is intended to denote interoperability and does not constitute: (i) an affiliation by Millennial Media and its suppliers with the user of the Trademarks, or (ii) an endorsement or approval by Company and its suppliers. 3. End Users and Mediators. You may distribute those components of the SDK that are expressly identified in the documentation as intended for distribution, solely as integrated in your application. If any component of the SDK is distributed with your application, then you will ensure that any end-user obtaining access to such application will be subject to an end-user license agreement containing terms at least as protective of Millennial Media and the SDK as the terms set forth in this Agreement. If Millennial Media has authorized you (in writing) to distribute the SDK to others (i.e., you are a “mediator”): (a) you may distribute the SDK, solely as incorporated into your software development kit that you distribute to developers, and (b) you will ensure that any person to whom it is distributed is subject to a license agreement containing terms at least as protective of Millennial Media and the SDK as the terms set forth in this Agreement (including the requirements in this Section 3). 4. Copyright Notice. You must include all copyright and other proprietary rights notices that accompany the SDK in any copies that you produce. 5. Proprietary Rights. Subject always to our ownership of the SDK, you will be the sole and exclusive owner of any software application developed using the SDK, excluding the SDK and any portions thereof. 6. Feedback. In the event that you provide us any ideas, thoughts, criticisms, suggested improvements or other feedback related to the Site or the Services, (collectively "Feedback"), you agree we may use the Feedback to modify our products and services and that you will not be due any compensation, including any royalty related to the product or service that incorporates your Feedback. You grant to us a worldwide, royalty-free, fully paid, perpetual, irrevocable license to use, reproduce, modify, translate, distribute, perform, display, import, sell, offer for sale, make, have made and otherwise exploit the Feedback in any form, media, or technology, whether now known or hereafter developed, and to allow others to do the same. 7. General Rules of Conduct. You agree not to use the SDK in a manner that: (a) Conducts or promotes any illegal activities; (b) Uploads, distributes, posts, transmits or otherwise makes available, content or information that is unlawful, harmful, threatening, abusive, harassing, defamatory, vulgar, obscene, libelous, invasive of another's privacy, hateful, harmful to minors in any way, or racially, ethnically or otherwise objectionable; (c) Uses the SDK in any manner which interferes with the performance or functionality of the APIs or the Millennial Media services; (d) Loads or transmits any form of virus, worm, Trojan horse, or other malicious code; (e) Promotes or advertises any item, good or service that (i) violates any applicable federal, state, or local law or regulation, or (ii) violates the terms of service of any website upon which the content is viewed; (f) Uses the SDK to generate unsolicited email advertisements or spam; or (g) Uses any automatic, electronic or manual process to access, search or harvest information from an individual. 8. Ownership. You understand and acknowledge that the software, code, proprietary methods and systems that make up the SDK are: (i) copyrighted by us and/or our licensors under United States and international copyright laws; (ii) subject to other intellectual property and proprietary rights and laws; and (iii) owned by us or our licensors. You must abide by all copyright notices, information, or restrictions contained in or attached to the SDK. If you are a U.S. Government end user, any of the components that constitute the SDK and its related documentation is a "commercial item" as that term is defined at 48 C.F.R. 2.101, consisting of "commercial computer software" and "commercial computer software documentation" as such terms are used in 48 C.F.R. 12.212. Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4, all U.S. Government end users acquire the SDK and any documentation provided with the SDK with only those rights set forth in this Agreement. 9. Confidential Information. You will safeguard, protect, respect, and maintain as confidential the SDK, the underlying computer code to which you may obtain or receive access, and the functional or technical design, logic, or other internal routines or workings of the SDK, which are considered confidential and proprietary to Millennial Media. You agree not to reproduce, disseminate, sell, distribute or commercially exploit any such confidential information of Millennial Media in any manner. These non-disclosure obligations shall survive termination or expiration of this Agreement. 10. Geographical Restrictions. We make no representation that all of the SDK is appropriate or available for use in locations outside the United States or all territories within the United States. If you choose to use the SDK, you do so on your own initiative and are responsible for compliance with local laws. 11. Modification of the SDK. We reserve the right to modify or discontinue the SDK with or without notice to you. We will not be liable to you or any third party should we exercise our right to modify or discontinue the SDK. If you object to any such changes, your sole recourse will be to cease use of the SDK. YOU AGREE THAT WE WILL NOT BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY TERMINATION OF YOUR ACCESS TO THE SDK. 12. Termination. You acknowledge and agree that we, at our sole discretion, may terminate your use of the SDK without prior notice for any reason at any time. You agree that we shall not be liable to You or any third party for termination of your access to the SDK. In the event of any termination, you will immediately cease use of the SDK. 13. DISCLAIMERS. THE SDK AS WELL AS ALL SERVICES, SOFTWARE, MATERIALS, AND TECHNOLOGY PROVIDED IN CONNECTION WITH THIS AGREEMENT, ARE PROVIDED ON AN "AS IS" AND "AS AVAILABLE" BASIS WITHOUT ANY WARRANTY OF ANY KIND. TO THE MAXIMUM EXTENT PERMITTED BY LAW, MILLENNIAL MEDIA, OUR OFFICERS, DIRECTORS, AGENTS, SUPPLIERS, AND EMPLOYEES EXPRESSLY DISCLAIM ALL REPRESENTATIONS AND WARRANTIES, WHETHER EXPRESS OR IMPLIED, ORAL OR WRITTEN, INCLUDING ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, ACCURACY, TITLE, QUIET ENJOYMENT, UN-INTERRUPTION, AND/OR SYSTEM INTEGRATION. MILLENNIAL MEDIA, OUR OFFICERS, DIRECTORS, AGENTS, SUPPLIERS, AND EMPLOYEES MAKE NO WARRANTY ABOUT THE ACCURACY, RELIABILITY, COMPLETENESS, QUALITY, OR TIMELINESS OF THE SDK, OR THAT PROBLEMS WITH THE FOREGOING WILL BE CORRECTED, OR THAT THE SDK ARE FREE OF VIRUSES AND OTHER HARMFUL COMPONENTS, OR THAT THEY WILL BE UNINTERRUPTED OR ERROR FREE. 14. LIMITATIONS OF LIABILITY AND CONTENT. YOU ACKNOWLEDGE AND AGREE THAT WE ARE ONLY WILLING TO PROVIDE ACCESS TO THE SDK IF YOU AGREE TO CERTAIN LIMITATIONS OF LIABILITY TO YOU AND TO THIRD PARTIES. IN NO EVENT WILL MILLENNIAL MEDIA, ITS PARENT, AFFILIATES, OFFICERS, DIRECTORS, AGENTS, SUPPLIERS OR EMPLOYEES BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY INDIRECT, INCIDENTAL, SPECIAL AND CONSEQUENTIAL DAMAGES OR LIKE DAMAGES, INCLUDING, LOST PROFITS, GOODWILL, LOST OPPORTUNITIES AND INTANGIBLE LOSSES, ARISING IN CONNECTION WITH THE SDK OR THESE TERMS, INCLUDING, FOR EXAMPLE AND CLARITY ONLY, DAMAGES RESULTING FROM LOST DATA, LOST EMPLOYMENT OPPORTUNITIES, OR BUSINESS INTERRUPTIONS, OR RESULTING FROM THE USE OR ACCESS TO, OR THE INABILITY TO USE OR TO USE THE SDK. THESE LIMITATIONS OF LIABILITY APPLY REGARDLESS OF THE NATURE OF ANY CLAIM, WHETHER BASED ON WARRANTY, CONTRACT, TORT, OR ANY OTHER LEGAL OR EQUITABLE THEORY, AND WHETHER OR NOT MILLENNIAL MEDIA IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 15. EXCLUSIVE REMEDY. YOU AGREE THAT YOUR SOLE AND EXCLUSIVE REMEDY FOR ANY CLAIMS ARISING IN CONNECTION WITH ANY VIOLATION BY US OF THIS AGREEMENT IS TO DISCONTINUE USING THE SDK. IN THE EVENT THAT A COURT DETERMINES THAT THE PRECEDING SENTENCE IS UNENFORCEABLE, OUR AGGREGATE LIABILITY FOR ALL CLAIMS ARISING IN CONNECTION WITH ANY VIOLATION OF THESE TERMS WILL NOT EXCEED ONE HUNDRED DOLLARS (U.S. $100.00). Some jurisdictions do not allow the exclusion of certain warranties or the limitation or exclusion of liability for certain types of damages. Accordingly, some of the above limitations and disclaimers may not apply to you. To the extent that we may not, as a matter of applicable law, disclaim any warranty or limit our liabilities, the scope and duration of such warranty and the extent of our liability will be the minimum permitted under such applicable law. 16. FORCE MAJUERE. WITHOUT LIMITING THE FOREGOING, UNDER NO CIRCUMSTANCES WILL WE OR OUR SUPPLIERS BE HELD LIABLE FOR ANY DELAY OR FAILURE IN PERFORMANCE RESULTING DIRECTLY OR INDIRECTLY FROM ACTS OF NATURE, FORCES, OR CAUSES BEYOND OUR REASONABLE CONTROL, INCLUDING, WITHOUT LIMITATION, INTERNET FAILURES, COMPUTER EQUIPMENT FAILURES, TELECOMMUNICATION EQUIPMENT FAILURES, OTHER EQUIPMENT FAILURES, ELECTRICAL POWER FAILURES, STRIKES, LABOR DISPUTES, RIOTS, INSURRECTIONS, CIVIL DISTURBANCES, SHORTAGES OF LABOR OR MATERIALS, FIRES, FLOODS, STORMS, EXPLOSIONS, ACTS OF GOD, WAR, GOVERNMENTAL ACTIONS, ORDERS OF DOMESTIC OR FOREIGN COURTS OR TRIBUNALS, OR NON-PERFORMANCE OF THIRD PARTIES. 17. Indemnification. You agree to indemnify, defend and hold harmless Millennial Media, our officers, directors, co-branders and other partners, employees, consultants and agents, from and against any and all third-party claims, liabilities, damages, losses, costs, expenses, fees (including reasonable attorneys' fees and court costs) that such parties may incur as a result of or arising from (i) any Content you submit, post or transmit through the SDK, (ii) your use of the SDK, (iii) your violation of this Agreement, (iv) your violation of any rights of any other person or entity, or (v) any viruses, trojan horses, worms, time bombs, cancelbots or other similar harmful or deleterious programming routines input by you into the SDK. 18. Electronic Communications. For contractual purposes, you (i) consent to receive communications from us in an electronic form; and (ii) agree that all terms and conditions, agreements, notices, documents, disclosures, and other communications ("Communications") that we provide to you electronically satisfy any legal requirement that such Communications would satisfy if it were in a writing. Your consent to receive Communications and do business electronically, and our agreement to do so, applies to all of your interactions and transactions with us. The foregoing does not affect your non-waivable rights. You may withdraw your consent to receive Communications electronically by contacting us in the manner described below. If you withdraw your consent, from that time forward, you must stop using the SDK. The withdrawal of your consent will not affect the legal validity and enforceability of any obligations or any electronic Communications provided or business transacted between us prior to the time you withdraw your consent. Please keep us informed of any changes in your email or mailing address so that you continue to receive all Communications without interruption. 19. General Terms. You are responsible for compliance with all applicable laws. This Agreement and the relationship between you and Millennial Media will be governed by the laws of the State of Maryland, without giving effect to any choice of laws principles that would require the application of the laws of a different country or state. Any legal action, suit or proceeding arising out of or relating to this Agreement, or your use of the SDK must be instituted exclusively in the federal or state courts located in Baltimore, Maryland and in no other jurisdiction. You further consent to exclusive personal jurisdiction and venue in, and agree to service of process issued or authorized by, any such court. This Agreement is personal to you, and you may not transfer, assign or delegate your right and/or duties under this Agreement to anyone else and any attempted assignment or delegation is void. You acknowledge that we have the right hereunder to seek an injunction, if necessary, to stop or prevent a breach of your obligations hereunder. The paragraph headings in this Agreement, shown in boldface type, are included only to help make this Agreement easier to read and have no binding effect. Any delay or failure by us to exercise or enforce any right or provision of this Agreement will not constitute a waiver of such right or provision. No waiver by us will have effect unless such waiver is set forth in writing, signed by us; nor will any such waiver of any breach or default constitute a waiver of any subsequent breach or default. This Agreement constitutes the complete and exclusive agreement between you and us with respect to the subject matter hereof, and supersedes all prior oral or written understandings, communications or agreements, other than your mobile advertising agreement with Millennial Media. If for any reason a court of competent jurisdiction finds any provision of this Agreement, or portion thereof, to be unenforceable, that provision of this Agreement will be enforced to the maximum extent permissible so as to effect the intent of the parties, and the remainder of this Agreement will continue in full force and effect. YOU AND MILLENNIAL MEDIA AGREE THAT ANY CAUSE OF ACTION ARISING OUT OF OR RELATED TO THE SITE, SERVICES OR MILLENNIAL MEDIA PLATFORM MUST COMMENCE WITHIN ONE (1) YEAR AFTER THE CAUSE OF ACTION ACCRUES, OTHERWISE, SUCH CAUSE OF ACTION IS PERMANENTLY BARRED. \ No newline at end of file diff --git a/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Headers/MMAdView.h b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Headers/MMAdView.h new file mode 100644 index 000000000..198d233a1 --- /dev/null +++ b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Headers/MMAdView.h @@ -0,0 +1,26 @@ +// +// MMAdView.h +// MMAdView +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +@interface MMAdView : UIView + +// Set view controller to show overlay from +@property (nonatomic, strong) UIViewController *rootViewController; +@property (nonatomic) MMOverlayOrientationType orientationType; + +// Initializes the ad view and pass in the controller to present overlays from +- (MMAdView *)initWithFrame:(CGRect)frame apid:(NSString *)apid rootViewController:(UIViewController *)viewController; + +// Request a new ad with a generic MMRequest +- (void)getAd:(MMCompletionBlock)callback; + +// Request a new ad with a custom MMRequest object (pass in location, keywords, & demographic information) +- (void)getAdWithRequest:(MMRequest *)request onCompletion:(MMCompletionBlock)callback; + +@end \ No newline at end of file diff --git a/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Headers/MMInterstitial.h b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Headers/MMInterstitial.h new file mode 100644 index 000000000..493f2e525 --- /dev/null +++ b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Headers/MMInterstitial.h @@ -0,0 +1,27 @@ +// +// MMInterstitial.h +// MMSDK +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +@interface MMInterstitial : NSObject + +// Fetch an interstitial for a given APID ++ (void)fetchWithRequest:(MMRequest *)request + apid:(NSString *)apid + onCompletion:(MMCompletionBlock)callback; + +// Check if an ad is available for a given APID ++ (BOOL)isAdAvailableForApid:(NSString *)apid; + +// Display an interstitial for a given APID. ViewController is required. Orientation is optional, use 0 if no preference. ++ (void)displayForApid:(NSString *)apid + fromViewController:(UIViewController *)viewController + withOrientation:(MMOverlayOrientationType)orientationType + onCompletion:(MMCompletionBlock)callback; + +@end diff --git a/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Headers/MMRequest.h b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Headers/MMRequest.h new file mode 100644 index 000000000..459dcc25a --- /dev/null +++ b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Headers/MMRequest.h @@ -0,0 +1,98 @@ +// +// MMRequest.h +// MMSDK +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +enum { + MMOverlayOrientationTypeAll, + MMOverlayOrientationTypePortrait, + MMOverlayOrientationTypeLandscape +}; +typedef NSUInteger MMOverlayOrientationType; + +typedef void (^MMCompletionBlock) (BOOL success, NSError *error); + +typedef enum { + MMEducationOther, + MMEducationNone, + MMEducationHighSchool, + MMEducationInCollege, + MMEducationSomeCollege, + MMEducationAssociates, + MMEducationBachelors, + MMEducationMasters, + MMEducationDoctorate +} MMEducation; + +typedef enum { + MMGenderOther, + MMGenderMale, + MMGenderFemale +} MMGender; + +typedef enum { + MMEthnicityMiddleEastern, + MMEthnicityAsian, + MMEthnicityBlack, + MMEthnicityHispanic, + MMEthnicityIndian, + MMEthnicityNativeAmerican, + MMEthnicityPacificIslander, + MMEthnicityWhite, + MMEthnicityOther +} MMEthnicity; + +typedef enum { + MMMaritalOther, + MMMaritalSingle, + MMMaritalRelationship, + MMMaritalMarried, + MMMaritalDivorced, + MMMaritalEngaged +} MMMaritalStatus; + +@interface MMRequest : NSObject + +// Creates an MMRequest object ++ (MMRequest *)request; + +#pragma mark - Location Information + +// Creates an MMRequest object with location ++ (MMRequest *)requestWithLocation:(CLLocation *)location; + +// Set location for the ad request +@property (nonatomic, retain) CLLocation *location; + +#pragma mark - Demographic Information + +// Set demographic information for the ad request +@property (nonatomic, assign) MMEducation education; +@property (nonatomic, assign) MMGender gender; +@property (nonatomic, assign) MMEthnicity ethnicity; +@property (nonatomic, assign) MMMaritalStatus maritalStatus; +@property (nonatomic, retain) NSNumber *age; +@property (nonatomic, copy) NSString *zipCode; + +#pragma mark - Contextual Information + +// Set an array of keywords (must be NSString values) +@property (nonatomic, retain) NSMutableArray *keywords; + +// Add keywords one at a time to the array +- (void)addKeyword:(NSString *)keyword; + +#pragma mark - Additional Information + +// Set additional parameters for the ad request. Value must be NSNumber or NSString. +- (void)setValue:(id)value forKey:(NSString *)key; + +#pragma mark - Request parameters (read-only) +@property (nonatomic, retain, readonly) NSMutableDictionary *dataParameters; + +@end diff --git a/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Headers/MMSDK.h b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Headers/MMSDK.h new file mode 100644 index 000000000..d2f787801 --- /dev/null +++ b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Headers/MMSDK.h @@ -0,0 +1,54 @@ +// +// MMSDK.h +// MMSDK +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +// NSNotification keys +extern NSString * const MillennialMediaAdWillTerminateApplication; +extern NSString * const MillennialMediaAdWasTapped; +extern NSString * const MillennialMediaAdModalWillAppear; +extern NSString * const MillennialMediaAdModalDidAppear; +extern NSString * const MillennialMediaAdModalWillDismiss; +extern NSString * const MillennialMediaAdModalDidDismiss; +extern NSString * const MillennialMediaKeyboardWillObscureAd; +extern NSString * const MillennialMediaKeyboardWillHide; + +// NSNotification userInfo keys +extern NSString * const MillennialMediaAdObjectKey; +extern NSString * const MillennialMediaAPIDKey; +extern NSString * const MillennialMediaAdTypeKey; + +// Millennial Media Ad Type keys +extern NSString * const MillennialMediaAdTypeBanner; +extern NSString * const MillennialMediaAdTypeInterstitial; + +typedef enum ErrorCode { + MMAdUnknownError = 0, + MMAdServerError = -500, + MMAdUnavailable = -503, + MMAdDisabled = -9999999 +} MMErrorCode; + +typedef enum LogLevel { + MMLOG_LEVEL_OFF = 0, + MMLOG_LEVEL_INFO = 1 << 0, + MMLOG_LEVEL_DEBUG = 1 << 1, + MMLOG_LEVEL_ERROR = 1 << 2, + MMLOG_LEVEL_FATAL = 1 << 3 +} MMLogLevel; + +@interface MMSDK : NSObject + ++ (void)initialize; ++ (NSString *)version; ++ (void)trackConversionWithGoalId:(NSString *)goalId; ++ (void)trackConversionWithGoalId:(NSString *)goalId requestData:(MMRequest *)request; ++ (void)setLogLevel:(MMLogLevel)level; ++ (void)trackEventWithId:(NSString *)eventId; + +@end diff --git a/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/MillennialMedia b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/MillennialMedia new file mode 100644 index 000000000..7cb98d0e1 Binary files /dev/null and b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/MillennialMedia differ diff --git a/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/A/Headers/MMAdView.h b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/A/Headers/MMAdView.h new file mode 100644 index 000000000..198d233a1 --- /dev/null +++ b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/A/Headers/MMAdView.h @@ -0,0 +1,26 @@ +// +// MMAdView.h +// MMAdView +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +@interface MMAdView : UIView + +// Set view controller to show overlay from +@property (nonatomic, strong) UIViewController *rootViewController; +@property (nonatomic) MMOverlayOrientationType orientationType; + +// Initializes the ad view and pass in the controller to present overlays from +- (MMAdView *)initWithFrame:(CGRect)frame apid:(NSString *)apid rootViewController:(UIViewController *)viewController; + +// Request a new ad with a generic MMRequest +- (void)getAd:(MMCompletionBlock)callback; + +// Request a new ad with a custom MMRequest object (pass in location, keywords, & demographic information) +- (void)getAdWithRequest:(MMRequest *)request onCompletion:(MMCompletionBlock)callback; + +@end \ No newline at end of file diff --git a/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/A/Headers/MMInterstitial.h b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/A/Headers/MMInterstitial.h new file mode 100644 index 000000000..493f2e525 --- /dev/null +++ b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/A/Headers/MMInterstitial.h @@ -0,0 +1,27 @@ +// +// MMInterstitial.h +// MMSDK +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +@interface MMInterstitial : NSObject + +// Fetch an interstitial for a given APID ++ (void)fetchWithRequest:(MMRequest *)request + apid:(NSString *)apid + onCompletion:(MMCompletionBlock)callback; + +// Check if an ad is available for a given APID ++ (BOOL)isAdAvailableForApid:(NSString *)apid; + +// Display an interstitial for a given APID. ViewController is required. Orientation is optional, use 0 if no preference. ++ (void)displayForApid:(NSString *)apid + fromViewController:(UIViewController *)viewController + withOrientation:(MMOverlayOrientationType)orientationType + onCompletion:(MMCompletionBlock)callback; + +@end diff --git a/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/A/Headers/MMRequest.h b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/A/Headers/MMRequest.h new file mode 100644 index 000000000..459dcc25a --- /dev/null +++ b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/A/Headers/MMRequest.h @@ -0,0 +1,98 @@ +// +// MMRequest.h +// MMSDK +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +enum { + MMOverlayOrientationTypeAll, + MMOverlayOrientationTypePortrait, + MMOverlayOrientationTypeLandscape +}; +typedef NSUInteger MMOverlayOrientationType; + +typedef void (^MMCompletionBlock) (BOOL success, NSError *error); + +typedef enum { + MMEducationOther, + MMEducationNone, + MMEducationHighSchool, + MMEducationInCollege, + MMEducationSomeCollege, + MMEducationAssociates, + MMEducationBachelors, + MMEducationMasters, + MMEducationDoctorate +} MMEducation; + +typedef enum { + MMGenderOther, + MMGenderMale, + MMGenderFemale +} MMGender; + +typedef enum { + MMEthnicityMiddleEastern, + MMEthnicityAsian, + MMEthnicityBlack, + MMEthnicityHispanic, + MMEthnicityIndian, + MMEthnicityNativeAmerican, + MMEthnicityPacificIslander, + MMEthnicityWhite, + MMEthnicityOther +} MMEthnicity; + +typedef enum { + MMMaritalOther, + MMMaritalSingle, + MMMaritalRelationship, + MMMaritalMarried, + MMMaritalDivorced, + MMMaritalEngaged +} MMMaritalStatus; + +@interface MMRequest : NSObject + +// Creates an MMRequest object ++ (MMRequest *)request; + +#pragma mark - Location Information + +// Creates an MMRequest object with location ++ (MMRequest *)requestWithLocation:(CLLocation *)location; + +// Set location for the ad request +@property (nonatomic, retain) CLLocation *location; + +#pragma mark - Demographic Information + +// Set demographic information for the ad request +@property (nonatomic, assign) MMEducation education; +@property (nonatomic, assign) MMGender gender; +@property (nonatomic, assign) MMEthnicity ethnicity; +@property (nonatomic, assign) MMMaritalStatus maritalStatus; +@property (nonatomic, retain) NSNumber *age; +@property (nonatomic, copy) NSString *zipCode; + +#pragma mark - Contextual Information + +// Set an array of keywords (must be NSString values) +@property (nonatomic, retain) NSMutableArray *keywords; + +// Add keywords one at a time to the array +- (void)addKeyword:(NSString *)keyword; + +#pragma mark - Additional Information + +// Set additional parameters for the ad request. Value must be NSNumber or NSString. +- (void)setValue:(id)value forKey:(NSString *)key; + +#pragma mark - Request parameters (read-only) +@property (nonatomic, retain, readonly) NSMutableDictionary *dataParameters; + +@end diff --git a/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/A/Headers/MMSDK.h b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/A/Headers/MMSDK.h new file mode 100644 index 000000000..d2f787801 --- /dev/null +++ b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/A/Headers/MMSDK.h @@ -0,0 +1,54 @@ +// +// MMSDK.h +// MMSDK +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +// NSNotification keys +extern NSString * const MillennialMediaAdWillTerminateApplication; +extern NSString * const MillennialMediaAdWasTapped; +extern NSString * const MillennialMediaAdModalWillAppear; +extern NSString * const MillennialMediaAdModalDidAppear; +extern NSString * const MillennialMediaAdModalWillDismiss; +extern NSString * const MillennialMediaAdModalDidDismiss; +extern NSString * const MillennialMediaKeyboardWillObscureAd; +extern NSString * const MillennialMediaKeyboardWillHide; + +// NSNotification userInfo keys +extern NSString * const MillennialMediaAdObjectKey; +extern NSString * const MillennialMediaAPIDKey; +extern NSString * const MillennialMediaAdTypeKey; + +// Millennial Media Ad Type keys +extern NSString * const MillennialMediaAdTypeBanner; +extern NSString * const MillennialMediaAdTypeInterstitial; + +typedef enum ErrorCode { + MMAdUnknownError = 0, + MMAdServerError = -500, + MMAdUnavailable = -503, + MMAdDisabled = -9999999 +} MMErrorCode; + +typedef enum LogLevel { + MMLOG_LEVEL_OFF = 0, + MMLOG_LEVEL_INFO = 1 << 0, + MMLOG_LEVEL_DEBUG = 1 << 1, + MMLOG_LEVEL_ERROR = 1 << 2, + MMLOG_LEVEL_FATAL = 1 << 3 +} MMLogLevel; + +@interface MMSDK : NSObject + ++ (void)initialize; ++ (NSString *)version; ++ (void)trackConversionWithGoalId:(NSString *)goalId; ++ (void)trackConversionWithGoalId:(NSString *)goalId requestData:(MMRequest *)request; ++ (void)setLogLevel:(MMLogLevel)level; ++ (void)trackEventWithId:(NSString *)eventId; + +@end diff --git a/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/A/MillennialMedia b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/A/MillennialMedia new file mode 100644 index 000000000..7cb98d0e1 Binary files /dev/null and b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/A/MillennialMedia differ diff --git a/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/Current/Headers/MMAdView.h b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/Current/Headers/MMAdView.h new file mode 100644 index 000000000..198d233a1 --- /dev/null +++ b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/Current/Headers/MMAdView.h @@ -0,0 +1,26 @@ +// +// MMAdView.h +// MMAdView +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +@interface MMAdView : UIView + +// Set view controller to show overlay from +@property (nonatomic, strong) UIViewController *rootViewController; +@property (nonatomic) MMOverlayOrientationType orientationType; + +// Initializes the ad view and pass in the controller to present overlays from +- (MMAdView *)initWithFrame:(CGRect)frame apid:(NSString *)apid rootViewController:(UIViewController *)viewController; + +// Request a new ad with a generic MMRequest +- (void)getAd:(MMCompletionBlock)callback; + +// Request a new ad with a custom MMRequest object (pass in location, keywords, & demographic information) +- (void)getAdWithRequest:(MMRequest *)request onCompletion:(MMCompletionBlock)callback; + +@end \ No newline at end of file diff --git a/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/Current/Headers/MMInterstitial.h b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/Current/Headers/MMInterstitial.h new file mode 100644 index 000000000..493f2e525 --- /dev/null +++ b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/Current/Headers/MMInterstitial.h @@ -0,0 +1,27 @@ +// +// MMInterstitial.h +// MMSDK +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +@interface MMInterstitial : NSObject + +// Fetch an interstitial for a given APID ++ (void)fetchWithRequest:(MMRequest *)request + apid:(NSString *)apid + onCompletion:(MMCompletionBlock)callback; + +// Check if an ad is available for a given APID ++ (BOOL)isAdAvailableForApid:(NSString *)apid; + +// Display an interstitial for a given APID. ViewController is required. Orientation is optional, use 0 if no preference. ++ (void)displayForApid:(NSString *)apid + fromViewController:(UIViewController *)viewController + withOrientation:(MMOverlayOrientationType)orientationType + onCompletion:(MMCompletionBlock)callback; + +@end diff --git a/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/Current/Headers/MMRequest.h b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/Current/Headers/MMRequest.h new file mode 100644 index 000000000..459dcc25a --- /dev/null +++ b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/Current/Headers/MMRequest.h @@ -0,0 +1,98 @@ +// +// MMRequest.h +// MMSDK +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +enum { + MMOverlayOrientationTypeAll, + MMOverlayOrientationTypePortrait, + MMOverlayOrientationTypeLandscape +}; +typedef NSUInteger MMOverlayOrientationType; + +typedef void (^MMCompletionBlock) (BOOL success, NSError *error); + +typedef enum { + MMEducationOther, + MMEducationNone, + MMEducationHighSchool, + MMEducationInCollege, + MMEducationSomeCollege, + MMEducationAssociates, + MMEducationBachelors, + MMEducationMasters, + MMEducationDoctorate +} MMEducation; + +typedef enum { + MMGenderOther, + MMGenderMale, + MMGenderFemale +} MMGender; + +typedef enum { + MMEthnicityMiddleEastern, + MMEthnicityAsian, + MMEthnicityBlack, + MMEthnicityHispanic, + MMEthnicityIndian, + MMEthnicityNativeAmerican, + MMEthnicityPacificIslander, + MMEthnicityWhite, + MMEthnicityOther +} MMEthnicity; + +typedef enum { + MMMaritalOther, + MMMaritalSingle, + MMMaritalRelationship, + MMMaritalMarried, + MMMaritalDivorced, + MMMaritalEngaged +} MMMaritalStatus; + +@interface MMRequest : NSObject + +// Creates an MMRequest object ++ (MMRequest *)request; + +#pragma mark - Location Information + +// Creates an MMRequest object with location ++ (MMRequest *)requestWithLocation:(CLLocation *)location; + +// Set location for the ad request +@property (nonatomic, retain) CLLocation *location; + +#pragma mark - Demographic Information + +// Set demographic information for the ad request +@property (nonatomic, assign) MMEducation education; +@property (nonatomic, assign) MMGender gender; +@property (nonatomic, assign) MMEthnicity ethnicity; +@property (nonatomic, assign) MMMaritalStatus maritalStatus; +@property (nonatomic, retain) NSNumber *age; +@property (nonatomic, copy) NSString *zipCode; + +#pragma mark - Contextual Information + +// Set an array of keywords (must be NSString values) +@property (nonatomic, retain) NSMutableArray *keywords; + +// Add keywords one at a time to the array +- (void)addKeyword:(NSString *)keyword; + +#pragma mark - Additional Information + +// Set additional parameters for the ad request. Value must be NSNumber or NSString. +- (void)setValue:(id)value forKey:(NSString *)key; + +#pragma mark - Request parameters (read-only) +@property (nonatomic, retain, readonly) NSMutableDictionary *dataParameters; + +@end diff --git a/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/Current/Headers/MMSDK.h b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/Current/Headers/MMSDK.h new file mode 100644 index 000000000..d2f787801 --- /dev/null +++ b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/Current/Headers/MMSDK.h @@ -0,0 +1,54 @@ +// +// MMSDK.h +// MMSDK +// +// Copyright (c) 2014 Millennial Media, Inc. All rights reserved. +// + +#import +#import + +// NSNotification keys +extern NSString * const MillennialMediaAdWillTerminateApplication; +extern NSString * const MillennialMediaAdWasTapped; +extern NSString * const MillennialMediaAdModalWillAppear; +extern NSString * const MillennialMediaAdModalDidAppear; +extern NSString * const MillennialMediaAdModalWillDismiss; +extern NSString * const MillennialMediaAdModalDidDismiss; +extern NSString * const MillennialMediaKeyboardWillObscureAd; +extern NSString * const MillennialMediaKeyboardWillHide; + +// NSNotification userInfo keys +extern NSString * const MillennialMediaAdObjectKey; +extern NSString * const MillennialMediaAPIDKey; +extern NSString * const MillennialMediaAdTypeKey; + +// Millennial Media Ad Type keys +extern NSString * const MillennialMediaAdTypeBanner; +extern NSString * const MillennialMediaAdTypeInterstitial; + +typedef enum ErrorCode { + MMAdUnknownError = 0, + MMAdServerError = -500, + MMAdUnavailable = -503, + MMAdDisabled = -9999999 +} MMErrorCode; + +typedef enum LogLevel { + MMLOG_LEVEL_OFF = 0, + MMLOG_LEVEL_INFO = 1 << 0, + MMLOG_LEVEL_DEBUG = 1 << 1, + MMLOG_LEVEL_ERROR = 1 << 2, + MMLOG_LEVEL_FATAL = 1 << 3 +} MMLogLevel; + +@interface MMSDK : NSObject + ++ (void)initialize; ++ (NSString *)version; ++ (void)trackConversionWithGoalId:(NSString *)goalId; ++ (void)trackConversionWithGoalId:(NSString *)goalId requestData:(MMRequest *)request; ++ (void)setLogLevel:(MMLogLevel)level; ++ (void)trackEventWithId:(NSString *)eventId; + +@end diff --git a/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/Current/MillennialMedia b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/Current/MillennialMedia new file mode 100644 index 000000000..7cb98d0e1 Binary files /dev/null and b/mediation/mediatedviews/libs/MMSDK/MillennialMedia.framework/Versions/Current/MillennialMedia differ diff --git a/mediation/mediatedviews/libs/MMSDK/libMMSDK_5.1.1.a b/mediation/mediatedviews/libs/MMSDK/libMMSDK_5.1.1.a deleted file mode 100644 index 22c17469c..000000000 Binary files a/mediation/mediatedviews/libs/MMSDK/libMMSDK_5.1.1.a and /dev/null differ diff --git a/mediation/mediatedviews/libs/README.txt b/mediation/mediatedviews/libs/README.txt new file mode 100644 index 000000000..d60effee2 --- /dev/null +++ b/mediation/mediatedviews/libs/README.txt @@ -0,0 +1,3 @@ +AdMob SDK Version: 6.9.2 +MillennialMedia SDK Version: 5.2.0 + diff --git a/mediation/mediating/AdMob/ANGADCustomBannerAd.m b/mediation/mediating/AdMob/ANGADCustomBannerAd.m index 2a8e8801e..3c880ab7d 100644 --- a/mediation/mediating/AdMob/ANGADCustomBannerAd.m +++ b/mediation/mediating/AdMob/ANGADCustomBannerAd.m @@ -13,16 +13,15 @@ limitations under the License. */ +#import "ANBasicConfig.h" +#import ANGADCUSTOMBANNERADHEADER +#import ANLOCATIONHEADER -#import "ANGADCustomBannerAd.h" -#import "ANBannerAdView.h" -#import "ANLocation.h" - -@interface ANGADCustomBannerAd () -@property (nonatomic, readwrite, strong) ANBannerAdView *bannerAdView; +@interface ANGADCUSTOMBANNERAD () +@property (nonatomic, readwrite, strong) ANBANNERADVIEW *bannerAdView; @end -@implementation ANGADCustomBannerAd +@implementation ANGADCUSTOMBANNERAD @synthesize delegate; @synthesize bannerAdView; @@ -33,11 +32,11 @@ - (void)requestBannerAd:(GADAdSize)adSize parameter:(NSString *)serverParameter label:(NSString *)serverLabel request:(GADCustomEventRequest *)customEventRequest -{ +{ // Create an ad request using custom targeting options from the custom event // request. CGRect frame = CGRectMake(0, 0, adSize.size.width, adSize.size.height); - self.bannerAdView = [ANBannerAdView adViewWithFrame:frame placementId:serverParameter adSize:adSize.size]; + self.bannerAdView = [ANBANNERADVIEW adViewWithFrame:frame placementId:serverParameter adSize:adSize.size]; self.bannerAdView.rootViewController = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; self.bannerAdView.delegate = self; @@ -45,7 +44,7 @@ - (void)requestBannerAd:(GADAdSize)adSize self.bannerAdView.shouldServePublicServiceAnnouncements = NO; if ([customEventRequest userHasLocation]) { - ANLocation *loc = [ANLocation getLocationWithLatitude:[customEventRequest userLatitude] + ANLOCATION *loc = [ANLOCATION getLocationWithLatitude:[customEventRequest userLatitude] longitude:[customEventRequest userLongitude] timestamp:nil horizontalAccuracy:[customEventRequest userLocationAccuracyInMeters]]; @@ -53,10 +52,10 @@ - (void)requestBannerAd:(GADAdSize)adSize } GADGender gadGender = [customEventRequest userGender]; - ANGender anGender = UNKNOWN; + ANGENDER anGender = (ANGENDER)UNKNOWN; if (gadGender != kGADGenderUnknown) { - if (gadGender == kGADGenderMale) anGender = MALE; - else if (gadGender == kGADGenderFemale) anGender = FEMALE; + if (gadGender == kGADGenderMale) anGender = (ANGENDER)MALE; + else if (gadGender == kGADGenderFemale) anGender = (ANGENDER)FEMALE; } [self.bannerAdView setGender:anGender]; @@ -76,33 +75,33 @@ - (void)requestBannerAd:(GADAdSize)adSize #pragma mark ANAdViewDelegate -- (void)adDidReceiveAd:(id)ad +- (void)adDidReceiveAd:(id)ad { - [self.delegate customEventBanner:self didReceiveAd:(ANBannerAdView *)ad]; + [self.delegate customEventBanner:self didReceiveAd:(ANBANNERADVIEW *)ad]; } -- (void)ad:(id)ad requestFailedWithError:(NSError *)error +- (void)ad:(id)ad requestFailedWithError:(NSError *)error { [self.delegate customEventBanner:self didFailAd:error]; } -- (void)adWasClicked:(id)ad { +- (void)adWasClicked:(id)ad { [self.delegate customEventBanner:self clickDidOccurInAd:self.bannerAdView]; } -- (void)adWillPresent:(id)ad { +- (void)adWillPresent:(id)ad { [self.delegate customEventBannerWillPresentModal:self]; } -- (void)adWillClose:(id)ad { +- (void)adWillClose:(id)ad { [self.delegate customEventBannerWillDismissModal:self]; } -- (void)adDidClose:(id)ad { +- (void)adDidClose:(id)ad { [self.delegate customEventBannerDidDismissModal:self]; } -- (void)adWillLeaveApplication:(id)ad { +- (void)adWillLeaveApplication:(id)ad { [self.delegate customEventBannerWillLeaveApplication:self]; } diff --git a/mediation/mediating/AdMob/ANGADCustomInterstitialAd.m b/mediation/mediating/AdMob/ANGADCustomInterstitialAd.m index 7387a3fe6..4e6be22fe 100644 --- a/mediation/mediating/AdMob/ANGADCustomInterstitialAd.m +++ b/mediation/mediating/AdMob/ANGADCustomInterstitialAd.m @@ -13,15 +13,15 @@ limitations under the License. */ +#import "ANBasicConfig.h" +#import ANGADCUSTOMINTERSTITIALADHEADER +#import ANLOCATIONHEADER -#import "ANGADCustomInterstitialAd.h" -#import "ANLocation.h" - -@interface ANGADCustomInterstitialAd () -@property (nonatomic, readwrite, strong) ANInterstitialAd *interstitialAd; +@interface ANGADCUSTOMINTERSTITIALAD () +@property (nonatomic, readwrite, strong) ANINTERSTITIALAD *interstitialAd; @end -@implementation ANGADCustomInterstitialAd +@implementation ANGADCUSTOMINTERSTITIALAD @synthesize interstitialAd; @synthesize delegate; @@ -30,12 +30,12 @@ @implementation ANGADCustomInterstitialAd - (void)requestInterstitialAdWithParameter:(NSString *)serverParameter label:(NSString *)serverLabel request:(GADCustomEventRequest *)customEventRequest { - self.interstitialAd = [[ANInterstitialAd alloc] initWithPlacementId:serverParameter]; + self.interstitialAd = [[ANINTERSTITIALAD alloc] initWithPlacementId:serverParameter]; self.interstitialAd.delegate = self; self.interstitialAd.shouldServePublicServiceAnnouncements = NO; if ([customEventRequest userHasLocation]) { - ANLocation *loc = [ANLocation getLocationWithLatitude:[customEventRequest userLatitude] + ANLOCATION *loc = [ANLOCATION getLocationWithLatitude:[customEventRequest userLatitude] longitude:[customEventRequest userLongitude] timestamp:nil horizontalAccuracy:[customEventRequest userLocationAccuracyInMeters]]; @@ -43,10 +43,10 @@ - (void)requestInterstitialAdWithParameter:(NSString *)serverParameter label:(NS } GADGender gadGender = [customEventRequest userGender]; - ANGender anGender = UNKNOWN; + ANGENDER anGender = (ANGENDER)UNKNOWN; if (gadGender != kGADGenderUnknown) { - if (gadGender == kGADGenderMale) anGender = MALE; - else if (gadGender == kGADGenderFemale) anGender = FEMALE; + if (gadGender == kGADGenderMale) anGender = (ANGENDER)MALE; + else if (gadGender == kGADGenderFemale) anGender = (ANGENDER)FEMALE; } [self.interstitialAd setGender:anGender]; @@ -67,35 +67,35 @@ - (void)requestInterstitialAdWithParameter:(NSString *)serverParameter label:(NS #pragma mark - #pragma mark ANAdDelegate -- (void)adDidReceiveAd:(id)ad +- (void)adDidReceiveAd:(id)ad { [self.delegate customEventInterstitial:self didReceiveAd:ad]; } -- (void)ad:(id)ad requestFailedWithError:(NSError *)error +- (void)ad:(id)ad requestFailedWithError:(NSError *)error { [self.delegate customEventInterstitial:self didFailAd:error]; } #pragma mark - -#pragma mark ANInterstitialAdDelegate +#pragma mark ANINTERSTITIALADDelegate -- (void)adFailedToDisplay:(ANInterstitialAd *)ad { +- (void)adFailedToDisplay:(ANINTERSTITIALAD *)ad { } -- (void)adWillPresent:(ANInterstitialAd *)ad { +- (void)adWillPresent:(ANINTERSTITIALAD *)ad { [self.delegate customEventInterstitialWillPresent:self]; } -- (void)adWillClose:(ANInterstitialAd *)ad { +- (void)adWillClose:(ANINTERSTITIALAD *)ad { [self.delegate customEventInterstitialWillDismiss:self]; } -- (void)adDidClose:(ANInterstitialAd *)adView { +- (void)adDidClose:(ANINTERSTITIALAD *)adView { [self.delegate customEventInterstitialDidDismiss:self]; } -- (void)adWillLeaveApplication:(id)ad { +- (void)adWillLeaveApplication:(id)ad { [self.delegate customEventInterstitialWillLeaveApplication:self]; } diff --git a/mediation/mediating/MoPub/ANMoPubMediationBanner.m b/mediation/mediating/MoPub/ANMoPubMediationBanner.m index a2d713c3d..c9967ef00 100644 --- a/mediation/mediating/MoPub/ANMoPubMediationBanner.m +++ b/mediation/mediating/MoPub/ANMoPubMediationBanner.m @@ -13,18 +13,18 @@ limitations under the License. */ -#import "ANMoPubMediationBanner.h" -#import "ANBannerAdView.h" -#import "ANLocation.h" +#import "ANBasicConfig.h" +#import ANMOPUBMEDIATIONBANNERHEADER +#import ANLOCATIONHEADER -@interface ANMoPubMediationBanner () +@interface ANMOPUBMEDIATIONBANNER () -@property (nonatomic, retain) ANBannerAdView *adBannerView; +@property (nonatomic, retain) ANBANNERADVIEW *adBannerView; @end -@implementation ANMoPubMediationBanner +@implementation ANMOPUBMEDIATIONBANNER - (id)init { @@ -42,7 +42,7 @@ - (void)invalidate - (void)requestAdWithSize:(CGSize)size customEventInfo:(NSDictionary *)info { - NSLog(@"Requesting AN Banner"); + NSLog(@"Requesting %@", NSStringFromClass([ANBANNERADVIEW class])); id widthParam = [info objectForKey:@"width"]; id heightParam = [info objectForKey:@"height"]; @@ -57,13 +57,13 @@ - (void)requestAdWithSize:(CGSize)size customEventInfo:(NSDictionary *)info CGRect frame = CGRectMake(0, 0, [widthParam floatValue], [heightParam floatValue]); - self.adBannerView = [ANBannerAdView adViewWithFrame:frame + self.adBannerView = [ANBANNERADVIEW adViewWithFrame:frame placementId:placementId]; self.adBannerView.rootViewController = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; if ([self.delegate location]) { CLLocation *mpLoc = [self.delegate location]; - ANLocation *anLoc = [ANLocation getLocationWithLatitude:(CGFloat)mpLoc.coordinate.latitude + ANLOCATION *anLoc = [ANLOCATION getLocationWithLatitude:(CGFloat)mpLoc.coordinate.latitude longitude:(CGFloat)mpLoc.coordinate.longitude timestamp:mpLoc.timestamp horizontalAccuracy:(CGFloat)mpLoc.horizontalAccuracy]; @@ -77,29 +77,29 @@ - (void)requestAdWithSize:(CGSize)size customEventInfo:(NSDictionary *)info [self.adBannerView loadAd]; } -- (void)adDidReceiveAd:(id)ad +- (void)adDidReceiveAd:(id)ad { - NSLog(@"Did load AN Banner"); + NSLog(@"Did load %@", NSStringFromClass([ANBANNERADVIEW class])); if (self.delegate) [self.delegate bannerCustomEvent:self didLoadAd:self.adBannerView]; } -- (void)ad:(id)ad requestFailedWithError:(NSError *)error +- (void)ad:(id)ad requestFailedWithError:(NSError *)error { - NSLog(@"Did fail to load AN Banner"); + NSLog(@"Did fail to load %@", NSStringFromClass([ANBANNERADVIEW class])); if (self.delegate) [self.delegate bannerCustomEvent:self didFailToLoadAdWithError:error]; } -- (void)adWillPresent:(id)ad { +- (void)adWillPresent:(id)ad { [self.delegate bannerCustomEventWillBeginAction:self]; } -- (void)adDidClose:(id)ad { +- (void)adDidClose:(id)ad { [self.delegate bannerCustomEventDidFinishAction:self]; } -- (void)adWillLeaveApplication:(id)ad { +- (void)adWillLeaveApplication:(id)ad { [self.delegate bannerCustomEventWillLeaveApplication:self]; } diff --git a/mediation/mediating/MoPub/ANMoPubMediationInterstitial.m b/mediation/mediating/MoPub/ANMoPubMediationInterstitial.m index 1bd6d2e85..f2bf388f7 100644 --- a/mediation/mediating/MoPub/ANMoPubMediationInterstitial.m +++ b/mediation/mediating/MoPub/ANMoPubMediationInterstitial.m @@ -13,17 +13,17 @@ limitations under the License. */ -#import "ANMoPubMediationInterstitial.h" -#import "ANInterstitialAd.h" -#import "ANLocation.h" +#import "ANBasicConfig.h" +#import ANMOPUBMEDIATIONINTERSTITIALHEADER +#import ANLOCATIONHEADER -@interface ANMoPubMediationInterstitial () +@interface ANMOPUBMEDIATIONINTERSTITIAL () -@property (nonatomic, retain) ANInterstitialAd *interstitial; +@property (nonatomic, retain) ANINTERSTITIALAD *interstitial; @end -@implementation ANMoPubMediationInterstitial +@implementation ANMOPUBMEDIATIONINTERSTITIAL @synthesize interstitial = _interstitial; @@ -33,7 +33,7 @@ @implementation ANMoPubMediationInterstitial - (void)requestInterstitialWithCustomEventInfo:(NSDictionary *)info { - NSLog(@"Requesting AN Interstitial"); + NSLog(@"Requesting %@", NSStringFromClass([ANINTERSTITIALAD class])); id placementId = [info objectForKey:@"id"]; @@ -44,12 +44,12 @@ - (void)requestInterstitialWithCustomEventInfo:(NSDictionary *)info return; } - self.interstitial = [[ANInterstitialAd alloc] initWithPlacementId:placementId]; + self.interstitial = [[ANINTERSTITIALAD alloc] initWithPlacementId:placementId]; self.interstitial.delegate = self; if ([self.delegate location]) { CLLocation *mpLoc = [self.delegate location]; - ANLocation *anLoc = [ANLocation getLocationWithLatitude:(CGFloat)mpLoc.coordinate.latitude + ANLOCATION *anLoc = [ANLOCATION getLocationWithLatitude:(CGFloat)mpLoc.coordinate.latitude longitude:(CGFloat)mpLoc.coordinate.longitude timestamp:mpLoc.timestamp horizontalAccuracy:(CGFloat)mpLoc.horizontalAccuracy]; @@ -73,45 +73,45 @@ - (void)dealloc self.interstitial = nil; } -- (void)adDidReceiveAd:(id)ad +- (void)adDidReceiveAd:(id)ad { - NSLog(@"Did load AN Interstitial"); + NSLog(@"Did load %@", NSStringFromClass([ANINTERSTITIALAD class])); if (self.delegate) [self.delegate interstitialCustomEvent:self didLoadAd:self.interstitial]; } -- (void)ad:(id)ad requestFailedWithError:(NSError *)error +- (void)ad:(id)ad requestFailedWithError:(NSError *)error { - NSLog(@"Did fail to load AN Interstitial"); + NSLog(@"Did fail to load %@", NSStringFromClass([ANINTERSTITIALAD class])); if (self.delegate) [self.delegate interstitialCustomEvent:self didFailToLoadAdWithError:error]; } -- (void)adFailedToDisplay:(ANInterstitialAd *)ad +- (void)adFailedToDisplay:(ANINTERSTITIALAD *)ad { - NSLog(@"Failed to display AN Interstitial"); + NSLog(@"Failed to display %@", NSStringFromClass([ANINTERSTITIALAD class])); if (self.delegate) { [self.delegate interstitialCustomEventDidExpire:self]; } } -- (void)adWillPresent:(id)ad { +- (void)adWillPresent:(id)ad { [self.delegate interstitialCustomEventWillAppear:self]; } -- (void)adDidPresent:(id)ad { +- (void)adDidPresent:(id)ad { [self.delegate interstitialCustomEventDidAppear:self]; } -- (void)adWillClose:(id)ad { +- (void)adWillClose:(id)ad { [self.delegate interstitialCustomEventWillDisappear:self]; } -- (void)adDidClose:(id)ad { +- (void)adDidClose:(id)ad { [self.delegate interstitialCustomEventDidDisappear:self]; } -- (void)adWasClicked:(id)ad { +- (void)adWasClicked:(id)ad { [self.delegate interstitialCustomEventDidReceiveTapEvent:self]; } diff --git a/sdk/ANAdProtocol.h b/sdk/ANAdProtocol.h index 72f97bbc5..b25e1fdaa 100644 --- a/sdk/ANAdProtocol.h +++ b/sdk/ANAdProtocol.h @@ -100,13 +100,6 @@ typedef enum _ANGender - (void)addCustomKeywordWithKey:(NSString *)key value:(NSString *)value; - (void)removeCustomKeywordWithKey:(NSString *)key; -#pragma mark Deprecated Properties - -/** - @deprecated This property is deprecated; use opensInNativeBrowser instead. - */ -@property (nonatomic, readwrite, assign) BOOL clickShouldOpenInBrowser DEPRECATED_ATTRIBUTE; - @end /** diff --git a/sdk/ANAdView.h b/sdk/ANAdView.h index f0aa9d7e8..11147ea50 100644 --- a/sdk/ANAdView.h +++ b/sdk/ANAdView.h @@ -17,11 +17,4 @@ @interface ANAdView : UIView -#pragma mark Deprecrated Properties - -/** - @deprecated This property is deprecated, use "opensInNativeBrowser" instead - */ -@property (nonatomic, readwrite, assign) BOOL clickShouldOpenInBrowser DEPRECATED_ATTRIBUTE; - @end diff --git a/sdk/Categories/NSTimer+ANCategory.m b/sdk/Categories/NSTimer+ANCategory.m index b01884ce1..d92672ed8 100644 --- a/sdk/Categories/NSTimer+ANCategory.m +++ b/sdk/Categories/NSTimer+ANCategory.m @@ -35,7 +35,7 @@ - (void)scheduleNow if (isScheduled) { - ANLogInfo(@"[ANTimer scheduleNow] %@ is scheduled", self); + ANLogInfo(@"[NSTimer scheduleNow] %@ is scheduled", self); } } diff --git a/sdk/Resources/errors.strings b/sdk/Resources/errors.strings index 0c2ed8739..0ea19ba54 100644 --- a/sdk/Resources/errors.strings +++ b/sdk/Resources/errors.strings @@ -12,7 +12,8 @@ "adsize_too_big"="E103: You requested an Ad larger than the measured ad space. Ad space size: %dx%d, request size: %dx%d"; "blank_ad"="E302: The server returned an ad with the response, but it was blank. There is probably an issue with the creative."; "opening_url_failed"="Failed to launch custom protocol: %@"; -"class_not_found_exception"="ClassNotFoundException caught while instantiating a Mediated Ad View"; +"mediation_instantiation_failure"="Instantiating mediated ad failed due to %@"; +"mediation_adding_invalid"="Adding %@ to invalid networks list"; "instantiating_class"="Instantiating %@"; "instance_exception"="MediatedAdView is null or not an instance of %@"; "mediation_finish"="Mediation Controller has finished."; diff --git a/sdk/internal/ANAdFetcher.h b/sdk/internal/ANAdFetcher.h index 1742349e0..647470bd6 100644 --- a/sdk/internal/ANAdFetcher.h +++ b/sdk/internal/ANAdFetcher.h @@ -13,15 +13,17 @@ limitations under the License. */ -#import "ANAdProtocol.h" +#import "ANBasicConfig.h" + +#import ANADPROTOCOLHEADER #import "ANAdResponse.h" #import "ANAdViewDelegate.h" #import "ANAdWebViewController.h" #import "ANBrowserViewController.h" -#import "ANCustomAdapter.h" +#import ANCUSTOMADAPTERHEADER @class ANMRAIDAdWebViewController; -@class ANLocation; +@class ANLOCATION; @protocol ANAdFetcherDelegate; extern NSString *const kANAdFetcherWillRequestAdNotification; @@ -42,13 +44,13 @@ extern NSString *const kANAdFetcherMediatedClassKey; - (void)startAutoRefreshTimer; - (void)setupAutoRefreshTimerIfNecessary; - (void)fireResultCB:(NSString *)resultCBString - reason:(ANAdResponseCode)reason + reason:(ANADRESPONSECODE)reason adObject:(id)adObject; - (void)processAdResponse:(ANAdResponse *)response; - (void)processFinalResponse:(ANAdResponse *)response; @end -@protocol ANAdFetcherDelegate +@protocol ANAdFetcherDelegate @optional - (void)adFetcher:(ANAdFetcher *)fetcher didFinishRequestWithResponse:(ANAdResponse *)response; @@ -59,4 +61,4 @@ extern NSString *const kANAdFetcherMediatedClassKey; // Delegate method for ANAdView subclasses to provide parameters that are specific to them. Should return an array of NSString - (NSArray *)extraParameters; -@end +@end \ No newline at end of file diff --git a/sdk/internal/ANAdFetcher.m b/sdk/internal/ANAdFetcher.m index 045b2ffc5..a8a9cb6ba 100644 --- a/sdk/internal/ANAdFetcher.m +++ b/sdk/internal/ANAdFetcher.m @@ -106,10 +106,8 @@ - (void)requestAdWithURL:(NSURL *)URL ANLogInfo(@"Beginning loading ad from URL: %@", self.URL); if (self.requestShouldBePosted) { - [[NSNotificationCenter defaultCenter] postNotificationName:kANAdFetcherWillRequestAdNotification - object:self - userInfo:[NSDictionary dictionaryWithObject:self.URL - forKey:kANAdFetcherAdRequestURLKey]]; + ANPostNotifications(kANAdFetcherWillRequestAdNotification, self, + @{kANAdFetcherAdRequestURLKey: self.URL}); self.requestShouldBePosted = NO; } @@ -305,41 +303,45 @@ - (NSString *)prependSDKJS:(NSString *)content { } -- (void)handleMediatedAds:(NSMutableArray *)mediatedAds -{ +- (void)handleMediatedAds:(NSMutableArray *)mediatedAds { // pop the front ad ANMediatedAd *currentAd = mediatedAds.firstObject; [mediatedAds removeObject:currentAd]; - - ANAdResponseCode errorCode = ANDefaultCode; + + // variables to pass into the failure handler if necessary + NSString *className = nil; + NSString *resultCB = nil; + NSString *errorInfo = nil; + ANADRESPONSECODE errorCode = (ANADRESPONSECODE)ANDefaultCode; if (!currentAd) { - ANLogDebug(@"ad was null"); - errorCode = ANAdResponseUnableToFill; + errorInfo = @"null mediated ad object"; + errorCode = (ANADRESPONSECODE)ANAdResponseUnableToFill; } else { - ANLogDebug([NSString stringWithFormat:ANErrorString(@"instantiating_class"), currentAd.className]); - [[NSNotificationCenter defaultCenter] postNotificationName:kANAdFetcherWillInstantiateMediatedClassNotification - object:self - userInfo:[NSDictionary dictionaryWithObject:currentAd.className - forKey:kANAdFetcherMediatedClassKey]]; - - Class adClass = NSClassFromString(currentAd.className); + className = currentAd.className; + resultCB = currentAd.resultCB; + + ANPostNotifications(kANAdFetcherWillInstantiateMediatedClassNotification, self, + @{kANAdFetcherMediatedClassKey: className}); + + ANLogDebug([NSString stringWithFormat:ANErrorString(@"instantiating_class"), className]); + + Class adClass = NSClassFromString(className); // Check to see if an instance of this class exists if (!adClass) { - ANLogError(ANErrorString(@"class_not_found_exception")); - errorCode = ANAdResponseMediatedSDKUnavailable; + errorInfo = @"ClassNotFoundError"; + errorCode = (ANADRESPONSECODE)ANAdResponseMediatedSDKUnavailable; } else { id adInstance = [[adClass alloc] init]; if (!adInstance || ![adInstance respondsToSelector:@selector(setDelegate:)]) { - ANLogError([NSString stringWithFormat:ANErrorString(@"instance_exception"), @"ANCustomAdapterBanner or ANCustomAdapterInterstitial"]); - errorCode = ANAdResponseMediatedSDKUnavailable; - } - else { - [self initMediationController:adInstance resultCB:currentAd.resultCB]; - + errorInfo = @"InstantiationError"; + errorCode = (ANADRESPONSECODE)ANAdResponseMediatedSDKUnavailable; + } else { + [self initMediationController:adInstance resultCB:resultCB]; + // Grab the size of the ad - interstitials will ignore this value CGSize sizeOfCreative = CGSizeMake([currentAd.width floatValue], [currentAd.height floatValue]); BOOL requestedSuccessfully = [self.mediationController @@ -347,24 +349,43 @@ - (void)handleMediatedAds:(NSMutableArray *)mediatedAds serverParameter:currentAd.param adUnitId:currentAd.adId adView:self.delegate]; - + if (!requestedSuccessfully) { - errorCode = ANAdResponseMediatedSDKUnavailable; + // don't add class to invalid networks list for this failure + className = nil; + errorInfo = @"ClassCastError"; + errorCode = (ANADRESPONSECODE)ANAdResponseMediatedSDKUnavailable; } } } } - if (errorCode != ANDefaultCode) { - [self clearMediationController]; - [self fireResultCB:currentAd.resultCB reason:errorCode adObject:nil]; - return; + + if (errorCode != (ANADRESPONSECODE)ANDefaultCode) { + [self handleInstantiationFailure:className resultCB:resultCB + errorCode:errorCode errorInfo:errorInfo]; } // otherwise, no error yet - // now we wait for a mediation adapter to hit one of our callbacks. + // wait for a mediation adapter to hit one of our callbacks. +} + +- (void)handleInstantiationFailure:(NSString *)className + resultCB:(NSString *)resultCB + errorCode:(ANADRESPONSECODE)errorCode + errorInfo:(NSString *)errorInfo { + if ([errorInfo length] > 0) { + ANLogError(ANErrorString(@"mediation_instantiation_failure"), errorInfo); + } + if ([className length] > 0) { + ANLogWarn(ANErrorString(@"mediation_adding_invalid"), className); + ANAddInvalidNetwork(className); + } + + [self clearMediationController]; + [self fireResultCB:resultCB reason:errorCode adObject:nil]; } -- (void)initMediationController:(id)adInstance +- (void)initMediationController:(id)adInstance resultCB:(NSString *)resultCB { // create new mediation controller self.mediationController = [ANMediationAdViewController initWithFetcher:self adViewDelegate:self.delegate]; @@ -491,7 +512,7 @@ - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)err #pragma mark handling resultCB - (void)fireResultCB:(NSString *)resultCBString - reason:(ANAdResponseCode)reason + reason:(ANADRESPONSECODE)reason adObject:(id)adObject { self.loading = NO; diff --git a/sdk/internal/ANAdRequestUrl.m b/sdk/internal/ANAdRequestUrl.m index d7ef92599..d625fcacf 100644 --- a/sdk/internal/ANAdRequestUrl.m +++ b/sdk/internal/ANAdRequestUrl.m @@ -13,6 +13,7 @@ limitations under the License. */ +#import "ANBasicConfig.h" #import "ANAdRequestUrl.h" #import "ANGlobal.h" @@ -74,6 +75,8 @@ - (NSURL *)buildRequestUrlWithBaseUrlString:(NSString *)baseUrlString { baseUrlString = [baseUrlString stringByAppendingString:[self ageParameter]]; baseUrlString = [baseUrlString stringByAppendingString:[self genderParameter]]; + baseUrlString = [baseUrlString stringByAppendingString:[self nonetParameter]]; + baseUrlString = [baseUrlString stringByAppendingString:[self jsonFormatParameter]]; baseUrlString = [baseUrlString stringByAppendingString:[self supplyTypeParameter]]; baseUrlString = [baseUrlString stringByAppendingString:[self sdkVersionParameter]]; @@ -157,7 +160,7 @@ - (NSString *)connectionTypeParameter { } - (NSString *)locationParameter { - ANLocation *location = [self.adFetcherDelegate location]; + ANLOCATION *location = [self.adFetcherDelegate location]; NSString *locationParameter = @""; if (location) { @@ -214,7 +217,7 @@ - (NSString *)ageParameter { } - (NSString *)genderParameter { - ANGender genderValue = [self.adFetcherDelegate gender]; + ANGENDER genderValue = [self.adFetcherDelegate gender]; if (genderValue == MALE) { return @"&gender=m"; } else if (genderValue == FEMALE) { @@ -263,6 +266,24 @@ - (NSString *)extraParameters { return extraString; } +- (NSString *)nonetParameter { + NSMutableString *nonetString = [NSMutableString stringWithString:@""]; + + NSMutableSet *nonetworks = ANInvalidNetworks(); + for (NSString *network in nonetworks) { + [nonetString appendString:network]; + [nonetString appendString:@","]; + } + + // remove trailing comma + if ([nonetString length] > 0) { + [nonetString deleteCharactersInRange: + NSMakeRange([nonetString length] - 1, 1)]; + } + + return [NSString stringWithFormat:@"&nonet=%@", nonetString]; +} + - (NSString *)jsonFormatParameter { return @"&format=json"; } diff --git a/sdk/internal/ANAdResponse.m b/sdk/internal/ANAdResponse.m index 90d397539..9e3eeed65 100644 --- a/sdk/internal/ANAdResponse.m +++ b/sdk/internal/ANAdResponse.m @@ -13,9 +13,10 @@ limitations under the License. */ +#import "ANBasicConfig.h" #import "ANAdResponse.h" -#import "ANCustomAdapter.h" +#import ANCUSTOMADAPTERHEADER #import "ANGlobal.h" #import "ANLogging.h" #import "ANMediatedAd.h" @@ -85,9 +86,13 @@ - (ANAdResponse *)processResponseData:(NSData *)data NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + if (!responseString) { + responseString = @""; + } ANLogDebug(@"Processing response: %@", responseString); - [[NSNotificationCenter defaultCenter] postNotificationName:kANAdFetcherDidReceiveResponseNotification object:self userInfo:[NSDictionary dictionaryWithObject:responseString ? responseString : @"" forKey:kANAdFetcherAdResponseKey]]; + ANPostNotifications(kANAdFetcherDidReceiveResponseNotification, self, + @{kANAdFetcherAdResponseKey: responseString}); if ([responseString length] < 1) return self; diff --git a/sdk/internal/ANAdView.m b/sdk/internal/ANAdView.m index 9cf61abd5..42769dc3c 100644 --- a/sdk/internal/ANAdView.m +++ b/sdk/internal/ANAdView.m @@ -13,13 +13,14 @@ limitations under the License. */ -#import "ANAdView.h" +#import "ANBasicConfig.h" +#import ANADVIEWHEADER #import "ANAdFetcher.h" #import "ANAdWebViewController.h" #import "ANBrowserViewController.h" #import "ANGlobal.h" -#import "ANInterstitialAd.h" +#import ANINTERSTITIALADHEADER #import "ANLogging.h" #import "ANMRAIDViewController.h" #import "UIView+ANCategory.h" @@ -29,15 +30,15 @@ #define CLOSE_BUTTON_OFFSET_X 4.0 #define CLOSE_BUTTON_OFFSET_Y 4.0 -@interface ANAdView () @property (nonatomic, readwrite, strong) UIView *contentView; @property (nonatomic, readwrite, strong) UIButton *closeButton; @property (nonatomic, readwrite, strong) ANAdFetcher *adFetcher; -@property (nonatomic, readwrite, weak) id delegate; -@property (nonatomic, readwrite, weak) id appEventDelegate; +@property (nonatomic, readwrite, weak) id delegate; +@property (nonatomic, readwrite, weak) id appEventDelegate; @property (nonatomic, readwrite, assign) CGRect defaultFrame; @property (nonatomic, readwrite, assign) CGRect defaultParentFrame; @property (nonatomic, strong) ANMRAIDViewController *mraidController; @@ -50,11 +51,10 @@ @interface ANAdView () interstitialDelegate = (id) self.delegate; + if ([self isMemberOfClass:[ANINTERSTITIALAD class]] + && [self.delegate conformsToProtocol:@protocol(ANINTERSTITIALADDELEGATE)]) { + ANINTERSTITIALAD *interstitialAd = (ANINTERSTITIALAD *)self; + id interstitialDelegate = (id) self.delegate; if ([interstitialDelegate respondsToSelector:@selector(adFailedToDisplay:)]) { [interstitialDelegate adFailedToDisplay:interstitialAd]; } diff --git a/sdk/internal/ANAdWebViewController.m b/sdk/internal/ANAdWebViewController.m index dcfd7f349..b8da74fed 100644 --- a/sdk/internal/ANAdWebViewController.m +++ b/sdk/internal/ANAdWebViewController.m @@ -491,7 +491,7 @@ - (void)moviePlayerDidFinish:(NSNotification *)notification - (void)createCalendarEventFromW3CCompliantJSONObject:(NSString *)json{ NSError* error; NSDictionary* jsonDict = [NSJSONSerialization JSONObjectWithData:[json dataUsingEncoding:NSUTF8StringEncoding] options:kNilOptions error:&error]; - ANLogDebug(@"%@ %@ | NSDictionary from JSON Calendar Object: %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd), jsonDict); + ANLogDebug(@"%@ | NSDictionary from JSON Calendar Object: %@", NSStringFromSelector(_cmd), jsonDict); NSString* description = [jsonDict objectForKey:@"description"]; NSString* location = [jsonDict objectForKey:@"location"]; @@ -543,13 +543,13 @@ - (void)createCalendarEventFromW3CCompliantJSONObject:(NSString *)json{ }else if (end) { event.endDate = [NSDate dateWithTimeIntervalSince1970:[end doubleValue]]; } else { - ANLogDebug(@"%@ %@ | No end date provided, defaulting to 60 minutes", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); + ANLogDebug(@"%@ | No end date provided, defaulting to 60 minutes", NSStringFromSelector(_cmd)); event.endDate = [event.startDate dateByAddingTimeInterval:3600]; // default to 60 mins } - ANLogDebug(@"%@ %@ | Event Start Date: %@, End Date: %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd), event.startDate, event.endDate); + ANLogDebug(@"%@ | Event Start Date: %@, End Date: %@", NSStringFromSelector(_cmd), event.startDate, event.endDate); } else { - ANLogWarn(@"%@ %@ | Cannot create calendar event, no start date provided", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); + ANLogWarn(@"%@ | Cannot create calendar event, no start date provided", NSStringFromSelector(_cmd)); return; } @@ -583,7 +583,7 @@ - (void)createCalendarEventFromW3CCompliantJSONObject:(NSString *)json{ else if ([frequency isEqualToString:@"monthly"]) frequency_ios = EKRecurrenceFrequencyMonthly; else if ([frequency isEqualToString:@"yearly"]) frequency_ios = EKRecurrenceFrequencyYearly; else { - ANLogWarn(@"%@ %@ | Invalid W3 frequency passed in: %@. Acceptable values are 'daily','weekly','monthly', and 'yearly'", NSStringFromClass([self class]), NSStringFromSelector(_cmd), frequency); + ANLogWarn(@"%@ | Invalid W3 frequency passed in: %@. Acceptable values are 'daily','weekly','monthly', and 'yearly'", NSStringFromSelector(_cmd), frequency); return; } @@ -615,7 +615,7 @@ - (void)createCalendarEventFromW3CCompliantJSONObject:(NSString *)json{ if (dayInWeekValue >= 0 && dayInWeekValue <= 6) { daysInWeek[daysInWeekIndex] = [EKRecurrenceDayOfWeek dayOfWeek:dayInWeekValue+1]; // Apple expects day of week value to be between 1 and 7 inclusive. } else { - ANLogWarn(@"%@ %@ | Invalid W3 day of week passed in: %d. Value should be between 0 and 6 inclusive.", NSStringFromClass([self class]), NSStringFromSelector(_cmd), dayInWeekValue); + ANLogWarn(@"%@ | Invalid W3 day of week passed in: %d. Value should be between 0 and 6 inclusive.", NSStringFromSelector(_cmd), dayInWeekValue); return; } } @@ -631,7 +631,7 @@ - (void)createCalendarEventFromW3CCompliantJSONObject:(NSString *)json{ daysInMonth[daysInMonthIndex] = [NSNumber numberWithInteger:dayInMonthValue-1]; } } else { - ANLogWarn(@"%@ %@ | Invalid W3 day of month passed in: %d. Value should be between -30 and 31 inclusive.", NSStringFromClass([self class]), NSStringFromSelector(_cmd), dayInMonthValue); + ANLogWarn(@"%@ | Invalid W3 day of month passed in: %d. Value should be between -30 and 31 inclusive.", NSStringFromSelector(_cmd), dayInMonthValue); return; } } @@ -646,11 +646,11 @@ - (void)createCalendarEventFromW3CCompliantJSONObject:(NSString *)json{ if (weekNumberValue <= 0) { // W3 reverse values from 0 to -3, Apple reverse values from -1 to -4 weekNumberValue--; } - ANLogDebug(@"%@ %@ | Adding EKRecurrenceDayOfWeek object with day number %d and week number %d", NSStringFromClass([self class]), NSStringFromSelector(_cmd), day.dayOfTheWeek, weekNumberValue); + ANLogDebug(@"%@ | Adding EKRecurrenceDayOfWeek object with day number %d and week number %d", NSStringFromSelector(_cmd), day.dayOfTheWeek, weekNumberValue); [updatedDaysInWeek addObject:[EKRecurrenceDayOfWeek dayOfWeek:day.dayOfTheWeek weekNumber:weekNumberValue]]; } } else { - ANLogWarn(@"%@ %@ | Invalid W3 week of month passed in: %d. Value should be between -3 and 4 inclusive.", NSStringFromClass([self class]), NSStringFromSelector(_cmd), weekNumberValue); + ANLogWarn(@"%@ | Invalid W3 week of month passed in: %d. Value should be between -3 and 4 inclusive.", NSStringFromSelector(_cmd), weekNumberValue); return; } } @@ -667,7 +667,7 @@ - (void)createCalendarEventFromW3CCompliantJSONObject:(NSString *)json{ for (NSNumber *monthInYear in monthsInYear) { NSInteger monthInYearValue = [monthInYear integerValue]; if (monthInYearValue < 0 && monthInYearValue > 12) { - ANLogWarn(@"%@ %@ | Invalid W3 month passed in: %d. Value should be between 1 and 12 inclusive.", NSStringFromClass([self class]), NSStringFromSelector(_cmd), monthInYearValue); + ANLogWarn(@"%@ | Invalid W3 month passed in: %d. Value should be between 1 and 12 inclusive.", NSStringFromSelector(_cmd), monthInYearValue); return; } } @@ -681,7 +681,7 @@ - (void)createCalendarEventFromW3CCompliantJSONObject:(NSString *)json{ daysInYear[daysInYearIndex] = [NSNumber numberWithInteger:dayInYearValue-1]; } } else { - ANLogWarn(@"%@ %@ | Invalid W3 day of year passed in: %d. Value should be between -364 and 365 inclusive.", NSStringFromClass([self class]), NSStringFromSelector(_cmd), dayInYearValue); + ANLogWarn(@"%@ | Invalid W3 day of year passed in: %d. Value should be between -364 and 365 inclusive.", NSStringFromSelector(_cmd), dayInYearValue); return; } } @@ -699,9 +699,9 @@ - (void)createCalendarEventFromW3CCompliantJSONObject:(NSString *)json{ if (rrule) { // EKRecurrenceRule will return nil if invalid values are passed in [event setRecurrenceRules:[NSArray arrayWithObjects:rrule, nil]]; - ANLogDebug(@"%@ %@ | Created Recurrence Rule: %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd), rrule); + ANLogDebug(@"%@ | Created Recurrence Rule: %@", NSStringFromSelector(_cmd), rrule); } else { - ANLogWarn(@"%@ %@ | Invalid EKRecurrenceRule Values Passed In.", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); + ANLogWarn(@"%@ | Invalid EKRecurrenceRule Values Passed In.", NSStringFromSelector(_cmd)); } } diff --git a/sdk/internal/ANBannerAdView.m b/sdk/internal/ANBannerAdView.m index 3738274ac..746d280c6 100644 --- a/sdk/internal/ANBannerAdView.m +++ b/sdk/internal/ANBannerAdView.m @@ -13,7 +13,8 @@ limitations under the License. */ -#import "ANBannerAdView.h" +#import "ANBasicConfig.h" +#import ANBANNERADVIEWHEADER #import "ANAdFetcher.h" #import "ANBrowserViewController.h" @@ -23,7 +24,7 @@ #define DEFAULT_ADSIZE CGSizeZero -@interface ANAdView (ANBannerAdView) +@interface ANADVIEW (ANBANNERADVIEW) - (void)initialize; - (void)loadAd; - (void)adDidReceiveAd; @@ -60,7 +61,7 @@ - (void)loadAdFromHtml:(NSString *)html @property (nonatomic, readwrite, assign) BOOL adjustFramesInResizeState; @end -@implementation ANBannerAdView +@implementation ANBANNERADVIEW @synthesize autoRefreshInterval = __autoRefreshInterval; @synthesize adSize = __adSize; @@ -82,11 +83,11 @@ - (void)awakeFromNib { __adSize = self.frame.size; } -+ (ANBannerAdView *)adViewWithFrame:(CGRect)frame placementId:(NSString *)placementId { ++ (ANBANNERADVIEW *)adViewWithFrame:(CGRect)frame placementId:(NSString *)placementId { return [[[self class] alloc] initWithFrame:frame placementId:placementId adSize:frame.size]; } -+ (ANBannerAdView *)adViewWithFrame:(CGRect)frame placementId:(NSString *)placementId adSize:(CGSize)size { ++ (ANBANNERADVIEW *)adViewWithFrame:(CGRect)frame placementId:(NSString *)placementId adSize:(CGSize)size { return [[[self class] alloc] initWithFrame:frame placementId:placementId adSize:size]; } @@ -148,12 +149,12 @@ - (void)setAutoRefreshInterval:(NSTimeInterval)autoRefreshInterval { // minimum allowed value for auto refresh is (15). if (autoRefreshInterval < kANBannerMinimumAutoRefreshInterval) { __autoRefreshInterval = kANBannerMinimumAutoRefreshInterval; - ANLogWarn(@"setAutoRefreshInterval called with value %f, but cannot be less than %f", autoRefreshInterval, kANBannerMinimumAutoRefreshInterval); + ANLogWarn(@"setAutoRefreshInterval called with value %f, AutoRefresh interval set to minimum allowed value %f", autoRefreshInterval, kANBannerMinimumAutoRefreshInterval); + } else { + __autoRefreshInterval = autoRefreshInterval; + ANLogDebug(@"AutoRefresh interval set to %f seconds", __autoRefreshInterval); } - ANLogDebug(@"AutoRefresh interval set to %f seconds", autoRefreshInterval); - __autoRefreshInterval = autoRefreshInterval; - [self.adFetcher stopAd]; ANLogDebug(@"New autoRefresh interval set. Making ad request."); diff --git a/sdk/internal/ANBasicConfig.h b/sdk/internal/ANBasicConfig.h new file mode 100644 index 000000000..2c87a59d0 --- /dev/null +++ b/sdk/internal/ANBasicConfig.h @@ -0,0 +1,85 @@ +/* Copyright 2014 APPNEXUS INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +#ifndef ANSDK_ANBasicConfig_h +#define ANSDK_ANBasicConfig_h + +#ifdef EXTERNAL_CONFIG +#include "ANExtendedConfig.h" +#else +#define ANADPROTOCOL ANAdProtocol +#define ANADVIEW ANAdView +#define ANBANNERADVIEW ANBannerAdView +#define ANINTERSTITIALAD ANInterstitialAd +#define ANLOCATION ANLocation +#define ANGENDER ANGender +#define ANADDELEGATE ANAdDelegate +#define ANAPPEVENTDELEGATE ANAppEventDelegate +#define ANBANNERADVIEWDELEGATE ANBannerAdViewDelegate +#define ANINTERSTITIALADDELEGATE ANInterstitialAdDelegate +#define ANTARGETINGPARAMETERS ANTargetingParameters +#define ANMOPUBMEDIATIONBANNER ANMoPubMediationBanner +#define ANMOPUBMEDIATIONINTERSTITIAL ANMoPubMediationInterstitial +#define ANGADCUSTOMBANNERAD ANGADCustomBannerAd +#define ANGADCUSTOMINTERSTITIALAD ANGADCustomInterstitialAd + +#define ANADPROTOCOLHEADER "ANAdProtocol.h" +#define ANADVIEWHEADER "ANAdView.h" +#define ANBANNERADVIEWHEADER "ANBannerAdView.h" +#define ANINTERSTITIALADHEADER "ANInterstitialAd.h" +#define ANLOCATIONHEADER "ANLocation.h" +#define ANTARGETINGPARAMETERSHEADER "ANTargetingParameters.h" +#define ANCUSTOMADAPTERHEADER "ANCustomAdapter.h" +#define ANMOPUBMEDIATIONBANNERHEADER "ANMoPubMediationBanner.h" +#define ANMOPUBMEDIATIONINTERSTITIALHEADER "ANMoPubMediationInterstitial.h" +#define ANGADCUSTOMBANNERADHEADER "ANGADCustomBannerAd.h" +#define ANGADCUSTOMINTERSTITIALADHEADER "ANGADCustomInterstitialAd.h" + +#define AN_RESOURCE_BUNDLE @"ANSDKResources" +#define AN_LOG_NAME @"APPNEXUS" + +#define ANCUSTOMADAPTER ANCustomAdapter +#define ANCUSTOMADAPTERBANNER ANCustomAdapterBanner +#define ANCUSTOMADAPTERINTERSTITIAL ANCustomAdapterInterstitial +#define ANCUSTOMADAPTERDELEGATE ANCustomAdapterDelegate +#define ANCUSTOMADAPTERBANNERDELEGATE ANCustomAdapterBannerDelegate +#define ANCUSTOMADAPTERINTERSTITIALDELEGATE ANCustomAdapterInterstitialDelegate +#define ANADRESPONSECODE ANAdResponseCode + +#define ANADADAPTERBANNERADMOB ANAdAdapterBannerAdMob +#define ANADADAPTERINTERSTITIALADMOB ANAdAdapterInterstitialAdMob +#define ANADADAPTERBANNERADMOBHEADER "ANAdAdapterBannerAdMob.h" +#define ANADADAPTERINTERSTITIALADMOBHEADER "ANAdAdapterInterstitialAdMob.h" + +#define ANADADAPTERBANNERIAD ANAdAdapterBanneriAd +#define ANADADAPTERBANNERIADHEADER "ANAdAdapterBanneriAd.h" +#define ANADADAPTERINTERSTITIALIAD ANAdAdapterInterstitialiAd +#define ANADADAPTERINTERSTITIALIADHEADER "ANAdAdapterInterstitialiAd.h" + +#define ANADADAPTERBANNERDFP ANAdAdapterBannerDFP +#define ANADADAPTERBANNERDFPHEADER "ANAdAdapterBannerDFP.h" +#define ANADADAPTERINTERSTITIALDFP ANAdAdapterInterstitialDFP +#define ANADADAPTERINTERSTITIALDFPHEADER "ANAdAdapterInterstitialDFP.h" + +#define ANADADAPTERBANNERMILLENNIALMEDIA ANAdAdapterBannerMillennialMedia +#define ANADADAPTERBANNERMILLENNIALMEDIAHEADER "ANAdAdapterBannerMillennialMedia.h" +#define ANADADAPTERINTERSTITIALMILLENNIALMEDIA ANAdAdapterInterstitialMillennialMedia +#define ANADADAPTERINTERSTITIALMILLENNIALMEDIAHEADER "ANAdAdapterInterstitialMillennialMedia.h" +#define ANADADAPTERMILLENNIALMEDIABASE ANAdAdapterMillennialMediaBase +#define ANADADAPTERMILLENNIALMEDIABASEHEADER "ANAdAdapterMillennialMediaBase.h" + +#endif + +#endif \ No newline at end of file diff --git a/sdk/internal/ANBrowserViewController.m b/sdk/internal/ANBrowserViewController.m index e07c4bf0a..c690f31dc 100644 --- a/sdk/internal/ANBrowserViewController.m +++ b/sdk/internal/ANBrowserViewController.m @@ -145,7 +145,7 @@ - (void)dealloc - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { NSURL *URL = [request URL]; - if (!self.isPresented) ANLogDebug(@"%@ | Loading URL: %@", NSStringFromClass([self class]), URL); + if (!self.isPresented) ANLogDebug(@"%@ | Loading URL: %@", NSStringFromSelector(_cmd), URL); if (hasHttpPrefix([URL scheme])) { return YES; @@ -157,7 +157,7 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *) [self.delegate browserViewControllerWillLaunchExternalApplication]; } if (!self.isPresented) { - ANLogDebug(@"%@ | Opening URL in external application: %@", NSStringFromClass([self class]), URL); + ANLogDebug(@"%@ | Opening URL in external application: %@", NSStringFromSelector(_cmd), URL); if ([self.delegate respondsToSelector:@selector(browserViewControllerWillNotPresent:)]) { [self.delegate browserViewControllerWillNotPresent:self]; } diff --git a/sdk/internal/ANGlobal.h b/sdk/internal/ANGlobal.h index 94b753842..3cf940de4 100644 --- a/sdk/internal/ANGlobal.h +++ b/sdk/internal/ANGlobal.h @@ -21,10 +21,9 @@ #define AN_MOBILE_HOSTNAME_INSTALL @"mediation.adnxs.com/install" #define AN_ERROR_DOMAIN @"com.appnexus.sdk" #define AN_ERROR_TABLE @"errors" -#define AN_RESOURCE_BUNDLE @"ANSDKResources" #define AN_DEFAULT_PLACEMENT_ID @"default_placement_id" -#define AN_SDK_VERSION @"1.15" +#define AN_SDK_VERSION @"1.16" #define APPNEXUS_BANNER_SIZE CGSizeMake(320, 50) #define APPNEXUS_MEDIUM_RECT_SIZE CGSizeMake(300, 250) @@ -69,3 +68,7 @@ NSString *convertToNSString(id value); CGRect adjustAbsoluteRectInWindowCoordinatesForOrientationGivenRect(CGRect rect); NSString *ANMRAIDBundlePath(); BOOL hasHttpPrefix(NSString *url); +NSMutableSet *ANInvalidNetworks(); +void ANAddInvalidNetwork(NSString *network); +void ANSetNotificationsEnabled(BOOL enabled); +void ANPostNotifications(NSString *name, id object, NSDictionary *userInfo); diff --git a/sdk/internal/ANGlobal.m b/sdk/internal/ANGlobal.m index d662c22d5..cc4a4d80e 100644 --- a/sdk/internal/ANGlobal.m +++ b/sdk/internal/ANGlobal.m @@ -14,6 +14,7 @@ */ #import "ANGlobal.h" +#import "ANBasicConfig.h" #import "ANLogging.h" @@ -101,8 +102,12 @@ BOOL isFirstLaunch() } NSBundle *ANResourcesBundle() { - NSString *resBundlePath = [[NSBundle mainBundle] pathForResource:AN_RESOURCE_BUNDLE ofType:@"bundle"]; - return resBundlePath ? [NSBundle bundleWithPath:resBundlePath] : [NSBundle mainBundle]; + static NSBundle *resBundle; + if (!resBundle) { + NSString *resBundlePath = [[NSBundle mainBundle] pathForResource:AN_RESOURCE_BUNDLE ofType:@"bundle"]; + resBundle = resBundlePath ? [NSBundle bundleWithPath:resBundlePath] : [NSBundle mainBundle]; + } + return resBundle; } NSString *convertToNSString(id value) { @@ -141,12 +146,12 @@ CGRect adjustAbsoluteRectInWindowCoordinatesForOrientationGivenRect(CGRect rect) NSString *ANMRAIDBundlePath() { NSBundle *resBundle = ANResourcesBundle(); if (!resBundle) { - ANLogError(@"Resource not found. Make sure the AppNexusSDKResources bundle is included in project"); + ANLogError(@"Resource not found. Make sure the %@ bundle is included in project", AN_RESOURCE_BUNDLE); return @""; } NSString *mraidBundlePath = [resBundle pathForResource:@"MRAID" ofType:@"bundle"]; if (!mraidBundlePath) { - ANLogError(@"Resource not found. Make sure the AppNexusSDKResources bundle is included in project"); + ANLogError(@"Resource not found. Make sure the %@ bundle is included in project", AN_RESOURCE_BUNDLE); return @""; } return mraidBundlePath; @@ -155,3 +160,33 @@ CGRect adjustAbsoluteRectInWindowCoordinatesForOrientationGivenRect(CGRect rect) BOOL hasHttpPrefix(NSString *url) { return ([url hasPrefix:@"http"] || [url hasPrefix:@"https"]); } + +static NSMutableSet *invalidNetworks; + +NSMutableSet *ANInvalidNetworks() { + if (!invalidNetworks) { + invalidNetworks = [NSMutableSet new]; + } + return invalidNetworks; +} + +void ANAddInvalidNetwork(NSString *network) { + if (!invalidNetworks) { + invalidNetworks = [NSMutableSet new]; + } + [invalidNetworks addObject:network]; +} + +static BOOL notificationsEnabled = NO; + +void ANSetNotificationsEnabled(BOOL enabled) { + notificationsEnabled = enabled; +} + +void ANPostNotifications(NSString *name, id object, NSDictionary *userInfo) { + if (notificationsEnabled) { + [[NSNotificationCenter defaultCenter] postNotificationName:name + object:object + userInfo:userInfo]; + } +} \ No newline at end of file diff --git a/sdk/internal/ANInterstitialAd.m b/sdk/internal/ANInterstitialAd.m index 5e9da5538..036310e49 100644 --- a/sdk/internal/ANInterstitialAd.m +++ b/sdk/internal/ANInterstitialAd.m @@ -13,7 +13,8 @@ limitations under the License. */ -#import "ANInterstitialAd.h" +#import "ANBasicConfig.h" +#import ANINTERSTITIALADHEADER #import "ANAdFetcher.h" #import "ANBrowserViewController.h" @@ -35,7 +36,7 @@ NSString *const kANInterstitialAdViewKey = @"kANInterstitialAdViewKey"; NSString *const kANInterstitialAdViewDateLoadedKey = @"kANInterstitialAdViewDateLoadedKey"; -@interface ANAdView (ANInterstitialAd) +@interface ANADVIEW (ANINTERSTITIALAD) - (void)initialize; - (void)loadAd; - (void)adDidReceiveAd; @@ -64,7 +65,7 @@ - (void)adShouldResetToDefault:(UIView *)contentView @end -@interface ANInterstitialAd () +@interface ANINTERSTITIALAD () @property (nonatomic, readwrite, strong) ANInterstitialAdViewController *controller; @property (nonatomic, readwrite, strong) NSMutableArray *precachedAdObjects; @@ -72,7 +73,7 @@ @interface ANInterstitialAd () @end -@implementation ANInterstitialAd +@implementation ANINTERSTITIALAD @synthesize controller = __controller; @synthesize precachedAdObjects = __precachedAdObjects; @synthesize delegate = __delegate; @@ -147,7 +148,7 @@ - (void)displayAdFromViewController:(UIViewController *)controller { controller.modalPresentationStyle = rootViewControllerDesiredPresentationStyle; }]; } - else if ([adToShow conformsToProtocol:@protocol(ANCustomAdapterInterstitial)]) { + else if ([adToShow conformsToProtocol:@protocol(ANCUSTOMADAPTERINTERSTITIAL)]) { [adToShow presentFromViewController:controller]; } else { @@ -193,7 +194,7 @@ - (BOOL)isReady { if (([dateLoaded timeIntervalSinceNow] * -1) < AN_INTERSTITIAL_AD_TIMEOUT) { // Found a valid ad id readyAd = [adDict objectForKey:kANInterstitialAdViewKey]; - if ([readyAd conformsToProtocol:@protocol(ANCustomAdapterInterstitial)]) { + if ([readyAd conformsToProtocol:@protocol(ANCUSTOMADAPTERINTERSTITIAL)]) { // if it's a mediated ad, check if it is ready if ([readyAd respondsToSelector:@selector(isReady)]) { return [readyAd isReady]; @@ -369,15 +370,15 @@ - (void)browserViewControllerShouldDismiss:(ANBrowserViewController *)controller #pragma mark ANInterstitialAdViewControllerDelegate - (void)interstitialAdViewControllerShouldDismiss:(ANInterstitialAdViewController *)controller { - __weak ANInterstitialAd *weakAd = self; + __weak ANINTERSTITIALAD *weakAd = self; [self.browserViewController dismissViewControllerAnimated:YES completion:^{ - ANInterstitialAd *ad = weakAd; + ANINTERSTITIALAD *ad = weakAd; ad.browserViewController = nil; }]; [self.controller dismissViewControllerAnimated:YES completion:^{ - ANInterstitialAd *ad = weakAd; + ANINTERSTITIALAD *ad = weakAd; ad.controller = nil; }]; } diff --git a/sdk/internal/ANLocation.m b/sdk/internal/ANLocation.m index 825d4bfb5..2bebc6f6c 100644 --- a/sdk/internal/ANLocation.m +++ b/sdk/internal/ANLocation.m @@ -13,9 +13,10 @@ limitations under the License. */ -#import "ANLocation.h" +#import "ANBasicConfig.h" +#import ANLOCATIONHEADER -@implementation ANLocation +@implementation ANLOCATION @synthesize latitude; @synthesize longitude; @@ -24,7 +25,7 @@ @implementation ANLocation #define DEFAULT_HOR_ACC 100 -+ (ANLocation *)getLocationWithLatitude:(CGFloat)latitude ++ (ANLOCATION *)getLocationWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude timestamp:(NSDate *)timestamp horizontalAccuracy:(CGFloat)horizontalAccuracy @@ -47,7 +48,7 @@ + (ANLocation *)getLocationWithLatitude:(CGFloat)latitude timestamp = [NSDate date]; // make a new object every time to make sure we don't use old data - ANLocation *location = [[ANLocation alloc] init]; + ANLOCATION *location = [[ANLOCATION alloc] init]; location.latitude = latitude; location.longitude = longitude; location.timestamp = timestamp; diff --git a/sdk/internal/ANLogging.m b/sdk/internal/ANLogging.m index 8c997ec05..79882c4ec 100644 --- a/sdk/internal/ANLogging.m +++ b/sdk/internal/ANLogging.m @@ -15,6 +15,9 @@ #import "ANLogging.h" +#import "ANBasicConfig.h" +#import "ANGlobal.h" + NSString *const kANLoggingNotification = @"kANLoggingNotification"; NSString *const kANLogMessageKey = @"kANLogMessageKey"; NSString *const kANLogMessageLevelKey = @"kANLogMessageLevelKey"; @@ -23,7 +26,7 @@ void _ANLogTrace(NSString *format, ...) { if ([ANLogManager getANLogLevel] <= ANLogLevelTrace) { - format = [NSString stringWithFormat:@"APPNEXUS: %@", format]; + format = [NSString stringWithFormat:@"%@: %@", AN_LOG_NAME, format]; va_list args; va_start(args, format); notifyListener([[[NSString alloc] initWithFormat:format arguments:args] init], ANLogLevelTrace); @@ -36,7 +39,7 @@ void _ANLogDebug(NSString *format, ...) { if ([ANLogManager getANLogLevel] <= ANLogLevelDebug) { - format = [NSString stringWithFormat:@"APPNEXUS: %@", format]; + format = [NSString stringWithFormat:@"%@: %@", AN_LOG_NAME, format]; va_list args; va_start(args, format); notifyListener([[[NSString alloc] initWithFormat:format arguments:args] init], ANLogLevelDebug); @@ -49,7 +52,7 @@ void _ANLogWarn(NSString *format, ...) { if ([ANLogManager getANLogLevel] <= ANLogLevelWarn) { - format = [NSString stringWithFormat:@"APPNEXUS: %@", format]; + format = [NSString stringWithFormat:@"%@: %@", AN_LOG_NAME, format]; va_list args; va_start(args, format); notifyListener([[[NSString alloc] initWithFormat:format arguments:args] init], ANLogLevelWarn); @@ -62,7 +65,7 @@ void _ANLogInfo(NSString *format, ...) { if ([ANLogManager getANLogLevel] <= ANLogLevelInfo) { - format = [NSString stringWithFormat:@"APPNEXUS: %@", format]; + format = [NSString stringWithFormat:@"%@: %@", AN_LOG_NAME, format]; va_list args; va_start(args, format); notifyListener([[[NSString alloc] initWithFormat:format arguments:args] init], ANLogLevelInfo); @@ -75,7 +78,7 @@ void _ANLogError(NSString *format, ...) { if ([ANLogManager getANLogLevel] <= ANLogLevelError) { - format = [NSString stringWithFormat:@"APPNEXUS: %@", format]; + format = [NSString stringWithFormat:@"%@: %@", AN_LOG_NAME, format]; va_list args; va_start(args, format); notifyListener([[[NSString alloc] initWithFormat:format arguments:args] init], ANLogLevelError); @@ -86,8 +89,7 @@ void _ANLogError(NSString *format, ...) void notifyListener(NSString *message, NSInteger messageLevel) { - [[NSNotificationCenter defaultCenter] postNotificationName:kANLoggingNotification - object:nil - userInfo:@{kANLogMessageKey: message, - kANLogMessageLevelKey: [NSNumber numberWithInteger:messageLevel]}]; + ANPostNotifications(kANLoggingNotification, nil, + @{kANLogMessageKey: message, + kANLogMessageLevelKey: [NSNumber numberWithInteger:messageLevel]}); } diff --git a/sdk/internal/ANMediationAdViewController.h b/sdk/internal/ANMediationAdViewController.h index 632987f36..84bc77ab9 100644 --- a/sdk/internal/ANMediationAdViewController.h +++ b/sdk/internal/ANMediationAdViewController.h @@ -20,7 +20,7 @@ @interface ANMediationAdViewController : NSObject - (void)startTimeout; -- (void)setAdapter:(id)adapter; +- (void)setAdapter:(id)adapter; - (void)clearAdapter; - (void)setResultCBString:(NSString *)resultCBString; - (BOOL)requestAd:(CGSize)size @@ -33,5 +33,5 @@ @end -@interface ANMediationAdViewController () +@interface ANMediationAdViewController () @end diff --git a/sdk/internal/ANMediationAdViewController.m b/sdk/internal/ANMediationAdViewController.m index 5a88f31a6..7f6fef5ae 100644 --- a/sdk/internal/ANMediationAdViewController.m +++ b/sdk/internal/ANMediationAdViewController.m @@ -13,16 +13,17 @@ limitations under the License. */ +#import "ANBasicConfig.h" #import "ANMediationAdViewController.h" -#import "ANBannerAdView.h" +#import ANBANNERADVIEWHEADER #import "ANGlobal.h" -#import "ANInterstitialAd.h" +#import ANINTERSTITIALADHEADER #import "ANLogging.h" -@interface ANMediationAdViewController () +@interface ANMediationAdViewController () -@property (nonatomic, readwrite, strong) id currentAdapter; +@property (nonatomic, readwrite, strong) id currentAdapter; @property (nonatomic, readwrite, assign) BOOL hasSucceeded; @property (nonatomic, readwrite, assign) BOOL hasFailed; @property (nonatomic, readwrite, assign) BOOL timeoutCanceled; @@ -62,45 +63,46 @@ - (BOOL)requestAd:(CGSize)size adUnitId:(NSString *)idString adView:(id)adView { // create targeting parameters object from adView properties - ANTargetingParameters *targetingParameters = [ANTargetingParameters new]; + ANTARGETINGPARAMETERS *targetingParameters = [ANTARGETINGPARAMETERS new]; targetingParameters.customKeywords = adView.customKeywords; targetingParameters.age = adView.age; targetingParameters.gender = adView.gender; targetingParameters.location = adView.location; targetingParameters.idforadvertising = ANUDID(); - - // if the class implements both banner and interstitial protocols, default to banner first - if ([[self.currentAdapter class] conformsToProtocol:@protocol(ANCustomAdapterBanner)] - && [self.currentAdapter respondsToSelector:@selector( - requestBannerAdWithSize:rootViewController:serverParameter:adUnitId:targetingParameters:)]) { - // make sure the container is a banner view - if ([adView isKindOfClass:[ANBannerAdView class]]) { + + if ([adView isKindOfClass:[ANBANNERADVIEW class]]) { + // make sure the container and protocol match + if ([[self.currentAdapter class] conformsToProtocol:@protocol(ANCUSTOMADAPTERBANNER)] + && [self.currentAdapter respondsToSelector:@selector(requestBannerAdWithSize:rootViewController:serverParameter:adUnitId:targetingParameters:)]) { [self startTimeout]; - ANBannerAdView *banner = (ANBannerAdView *)adView; + ANBANNERADVIEW *banner = (ANBANNERADVIEW *)adView; - id bannerAdapter = (id) self.currentAdapter; + id bannerAdapter = (id) self.currentAdapter; [bannerAdapter requestBannerAdWithSize:size rootViewController:banner.rootViewController serverParameter:parameterString adUnitId:idString targetingParameters:targetingParameters]; return YES; + } else { + ANLogError([NSString stringWithFormat:ANErrorString(@"instance_exception"), @"CustomAdapterBanner"]); } - } else if ([[self.currentAdapter class] conformsToProtocol:@protocol(ANCustomAdapterInterstitial)] - && [self.currentAdapter respondsToSelector:@selector( - requestInterstitialAdWithParameter:adUnitId:targetingParameters:)]) { - // make sure the container is an interstitial view - if ([adView isKindOfClass:[ANInterstitialAd class]]) { + } else if ([adView isKindOfClass:[ANINTERSTITIALAD class]]) { + // make sure the container and protocol match + if ([[self.currentAdapter class] conformsToProtocol:@protocol(ANCUSTOMADAPTERINTERSTITIAL)] + && [self.currentAdapter respondsToSelector:@selector(requestInterstitialAdWithParameter:adUnitId:targetingParameters:)]) { [self startTimeout]; - id interstitialAdapter = (id) self.currentAdapter; + id interstitialAdapter = (id) self.currentAdapter; [interstitialAdapter requestInterstitialAdWithParameter:parameterString adUnitId:idString - targetingParameters:targetingParameters]; + targetingParameters:targetingParameters]; return YES; + } else { + ANLogError([NSString stringWithFormat:ANErrorString(@"instance_exception"), @"CustomAdapterInterstitial"]); } } - - ANLogError([NSString stringWithFormat:ANErrorString(@"instance_exception"), @"ANCustomAdapterBanner or ANCustomAdapterInterstitial"]); + + // executes iff request was unsuccessful [self clearAdapter]; return NO; } @@ -113,13 +115,13 @@ - (void)didLoadBannerAd:(UIView *)view { #pragma mark ANCustomAdapterInterstitialDelegate -- (void)didLoadInterstitialAd:(id)adapter { +- (void)didLoadInterstitialAd:(id)adapter { [self didReceiveAd:adapter]; } #pragma mark ANCustomAdapterDelegate -- (void)didFailToLoadAd:(ANAdResponseCode)errorCode { +- (void)didFailToLoadAd:(ANADRESPONSECODE)errorCode { [self didFailToReceiveAd:errorCode]; } @@ -170,17 +172,17 @@ - (BOOL)checkIfHasResponded { - (void)didReceiveAd:(id)adObject { if ([self checkIfHasResponded]) return; if (!adObject) { - [self didFailToReceiveAd:ANAdResponseInternalError]; + [self didFailToReceiveAd:(ANADRESPONSECODE)ANAdResponseInternalError]; return; } self.hasSucceeded = YES; ANLogDebug(@"received an ad from the adapter"); - [self.fetcher fireResultCB:self.resultCBString reason:ANAdResponseSuccessful adObject:adObject]; + [self.fetcher fireResultCB:self.resultCBString reason:(ANADRESPONSECODE)ANAdResponseSuccessful adObject:adObject]; } -- (void)didFailToReceiveAd:(ANAdResponseCode)errorCode { +- (void)didFailToReceiveAd:(ANADRESPONSECODE)errorCode { if ([self checkIfHasResponded]) return; ANAdFetcher *fetcher = self.fetcher; NSString *resultCBString = self.resultCBString; @@ -200,7 +202,7 @@ - (void)startTimeout { ANMediationAdViewController *strongSelf = weakSelf; if (!strongSelf || strongSelf.timeoutCanceled) return; ANLogWarn(ANErrorString(@"mediation_timeout")); - [strongSelf didFailToReceiveAd:ANAdResponseInternalError]; + [strongSelf didFailToReceiveAd:(ANADRESPONSECODE)ANAdResponseInternalError]; }); } diff --git a/sdk/internal/ANTargetingParameters.m b/sdk/internal/ANTargetingParameters.m index 1f0878f31..58db6ef52 100644 --- a/sdk/internal/ANTargetingParameters.m +++ b/sdk/internal/ANTargetingParameters.m @@ -13,8 +13,9 @@ limitations under the License. */ -#import "ANTargetingParameters.h" +#import "ANBasicConfig.h" +#import ANTARGETINGPARAMETERSHEADER -@implementation ANTargetingParameters +@implementation ANTARGETINGPARAMETERS @end