From a10c62cb8cf2e4e5bd67ab0a5f01b65f57224e9a Mon Sep 17 00:00:00 2001 From: Jose Cabal-Ugaz Date: Mon, 10 Mar 2014 18:36:08 -0400 Subject: [PATCH 1/4] MS-593 Re-arranged settings screen. Fixed iOS 7.1 picker view display issue, and 64-bit architecture compile issue (new Xcode will try to compile 64 bit for 64 bit phones, binary code not compatible with 64 bit). --- .../AppNexusSDKApp.xcodeproj/project.pbxproj | 10 +- .../Classes/Controllers/AdSettingsTVC.m | 49 +- .../AppNexusSDKAppViewController.m | 6 +- .../en.lproj/MainStoryboard.storyboard | 434 +++++++++--------- 4 files changed, 263 insertions(+), 236 deletions(-) diff --git a/examples/AppNexusSDKApp/AppNexusSDKApp.xcodeproj/project.pbxproj b/examples/AppNexusSDKApp/AppNexusSDKApp.xcodeproj/project.pbxproj index 772517791..cd331d0f4 100644 --- a/examples/AppNexusSDKApp/AppNexusSDKApp.xcodeproj/project.pbxproj +++ b/examples/AppNexusSDKApp/AppNexusSDKApp.xcodeproj/project.pbxproj @@ -891,7 +891,10 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD)"; + ARCHS = ( + "armv7,", + armv7s, + ); CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; @@ -926,7 +929,10 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD)"; + ARCHS = ( + "armv7,", + armv7s, + ); CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; diff --git a/examples/AppNexusSDKApp/AppNexusSDKApp/Classes/Controllers/AdSettingsTVC.m b/examples/AppNexusSDKApp/AppNexusSDKApp/Classes/Controllers/AdSettingsTVC.m index 66130aed3..414ba3cdb 100644 --- a/examples/AppNexusSDKApp/AppNexusSDKApp/Classes/Controllers/AdSettingsTVC.m +++ b/examples/AppNexusSDKApp/AppNexusSDKApp/Classes/Controllers/AdSettingsTVC.m @@ -36,19 +36,25 @@ static NSString *const AdSettingsSectionHeaderViewIdentifier = @"AdSettingsSectionHeaderViewIdentifier"; static NSInteger const AdSettingsSectionHeaderGeneralIndex = 0; -static NSInteger const AdSettingsSectionHeaderAdvancedIndex = 1; -static NSInteger const AdSettingsSectionHeaderDebugAuctionIndex = 2; +static NSInteger const AdSettingsSectionHeaderTargetingIndex = 1; +static NSInteger const AdSettingsSectionHeaderAdvancedIndex = 2; +static NSInteger const AdSettingsSectionHeaderDebugAuctionIndex = 3; static BOOL AdSettingsSectionGeneralIsOpen = YES; +static BOOL AdSettingsSectionTargetingIsOpen = NO; static BOOL AdSettingsSectionAdvancedIsOpen = NO; static BOOL AdSettingsSectionDebugAuctionIsOpen = NO; static NSString *const AdSettingsSectionHeaderTitleLabelGeneral = @"General"; +static NSString *const AdSettingsSectionHeaderTitleLabelTargeting = @"Targeting"; static NSString *const AdSettingsSectionHeaderTitleLabelAdvanced = @"Advanced"; -static NSString *const AdSettingsSectionHeaderTitleLabelDebugAuction = @"Debug Auction"; +static NSString *const AdSettingsSectionHeaderTitleLabelDebugAuction = @"Diagnostics"; -static NSInteger const AdSettingsSizePickerIndex = 3; -static NSInteger const AdSettingsRefreshRatePickerIndex = 5; +static NSInteger const AdSettingsSizePickerIndex = 2; +static NSInteger const AdSettingsRefreshRatePickerIndex = 3; + +static NSInteger const AdSettingsSizePickerSection = 0; +static NSInteger const AdSettingsRefreshRatePickerSection = 2; #pragma end @@ -103,12 +109,7 @@ - (IBAction)makeKeyboardDisappear:(id)sender { } - (void)viewWillDisappear:(BOOL)animated { - if (self.sizePickerViewIsVisible || self.refreshRatePickerViewIsVisible) { - self.sizePickerViewIsVisible = NO; - self.refreshRatePickerViewIsVisible = NO; - [self.tableView beginUpdates]; - [self.tableView endUpdates]; - } + [self hidePickerViews]; } #pragma mark Current Settings Setup @@ -137,6 +138,8 @@ - (void)pickerViewSetup { animated:NO]; self.sizePickerViewIsVisible = NO; self.refreshRatePickerViewIsVisible = NO; + [self.sizePickerView setHidden:YES]; + [self.refreshRatePickerView setHidden:YES]; } #pragma mark Picker Views - Delegate Methods @@ -530,6 +533,10 @@ - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger sectionHeaderView.titleLabel.text = AdSettingsSectionHeaderTitleLabelDebugAuction; sectionHeaderView.disclosureButton.selected = AdSettingsSectionDebugAuctionIsOpen; break; + case (AdSettingsSectionHeaderTargetingIndex): + sectionHeaderView.titleLabel.text = AdSettingsSectionHeaderTitleLabelTargeting; + sectionHeaderView.disclosureButton.selected = AdSettingsSectionTargetingIsOpen; + break; default: sectionHeaderView.titleLabel.text = @""; sectionHeaderView.disclosureButton.selected = NO; @@ -558,6 +565,10 @@ - (void)sectionHeaderView:(AppNexusSDKAppSectionHeaderView *)sectionHeaderView s if (AdSettingsSectionDebugAuctionIsOpen) return; AdSettingsSectionDebugAuctionIsOpen = YES; break; + case (AdSettingsSectionHeaderTargetingIndex): + if (AdSettingsSectionTargetingIsOpen) return; + AdSettingsSectionTargetingIsOpen = YES; + break; default: return; } @@ -583,6 +594,10 @@ - (void)sectionHeaderView:(AppNexusSDKAppSectionHeaderView *)sectionHeaderView s if (!AdSettingsSectionDebugAuctionIsOpen) return; AdSettingsSectionDebugAuctionIsOpen = NO; break; + case (AdSettingsSectionHeaderTargetingIndex): + if (!AdSettingsSectionTargetingIsOpen) return; + AdSettingsSectionTargetingIsOpen = NO; + break; default: return; } @@ -605,6 +620,9 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger case AdSettingsSectionHeaderDebugAuctionIndex: if (!AdSettingsSectionDebugAuctionIsOpen) return 0; break; + case AdSettingsSectionHeaderTargetingIndex: + if (!AdSettingsSectionTargetingIsOpen) return 0; + break; default: break; } @@ -632,11 +650,10 @@ - (void)sdkAppModalViewControllerShouldDismiss:(AppNexusSDKAppModalViewControlle #pragma mark UITableViewDelegate - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - if (indexPath.section==AdSettingsSectionHeaderGeneralIndex) { - if ((indexPath.item == AdSettingsSizePickerIndex && !self.sizePickerViewIsVisible) || - (indexPath.item == AdSettingsRefreshRatePickerIndex && !self.refreshRatePickerViewIsVisible)) { - return 0.0f; - } + BOOL isSizePickerCell = indexPath.section == AdSettingsSizePickerSection && indexPath.item == AdSettingsSizePickerIndex; + BOOL isRefreshRatePickerCell = indexPath.section == AdSettingsRefreshRatePickerSection && indexPath.item == AdSettingsRefreshRatePickerIndex; + if ((isSizePickerCell && !self.sizePickerViewIsVisible) || (isRefreshRatePickerCell && !self.refreshRatePickerViewIsVisible)) { + return 0.0f; } return [super tableView:tableView heightForRowAtIndexPath:indexPath]; } diff --git a/examples/AppNexusSDKApp/AppNexusSDKApp/Classes/Controllers/AppNexusSDKAppViewController.m b/examples/AppNexusSDKApp/AppNexusSDKApp/Classes/Controllers/AppNexusSDKAppViewController.m index de0e7e725..a1fcf5c40 100644 --- a/examples/AppNexusSDKApp/AppNexusSDKApp/Classes/Controllers/AppNexusSDKAppViewController.m +++ b/examples/AppNexusSDKApp/AppNexusSDKApp/Classes/Controllers/AppNexusSDKAppViewController.m @@ -150,12 +150,12 @@ - (NSMutableArray *)mediatedClasses { - (void)loadInitialVC { [self setInitialVCTabBarItem]; - [self loadPreviewVC]; + [self loadSettingsVC]; } - (void)setInitialVCTabBarItem { - if ([self.mainTabBar selectedItem] != self.previewTabBarItem) { - [self.mainTabBar setSelectedItem:self.previewTabBarItem]; + if ([self.mainTabBar selectedItem] != self.settingsTabBarItem) { + [self.mainTabBar setSelectedItem:self.settingsTabBarItem]; } } diff --git a/examples/AppNexusSDKApp/AppNexusSDKApp/en.lproj/MainStoryboard.storyboard b/examples/AppNexusSDKApp/AppNexusSDKApp/en.lproj/MainStoryboard.storyboard index a4cd0cabe..45b8dae01 100644 --- a/examples/AppNexusSDKApp/AppNexusSDKApp/en.lproj/MainStoryboard.storyboard +++ b/examples/AppNexusSDKApp/AppNexusSDKApp/en.lproj/MainStoryboard.storyboard @@ -1,8 +1,8 @@ - + - + @@ -105,7 +105,7 @@ - + @@ -138,7 +138,7 @@ - + @@ -584,44 +584,10 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -661,7 +627,7 @@ - + @@ -697,7 +663,7 @@ - + @@ -713,199 +679,53 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - - - - - - + + + + + + + + + - + @@ -945,7 +765,7 @@ - + @@ -980,7 +800,7 @@ - + @@ -1020,7 +840,7 @@ - + @@ -1044,7 +864,7 @@ - + @@ -1086,7 +906,191 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1873,4 +1877,4 @@ Cg - \ No newline at end of file + From e515861f238040060578bf9536eedeabe99278b9 Mon Sep 17 00:00:00 2001 From: Jose Cabal-Ugaz Date: Tue, 11 Mar 2014 14:05:32 -0400 Subject: [PATCH 2/4] MS-596 Set rootViewController property in ANBannerAdView.h to weak, from assign. --- sdk/ANBannerAdView.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ANBannerAdView.h b/sdk/ANBannerAdView.h index 14faf1f19..1473a1363 100644 --- a/sdk/ANBannerAdView.h +++ b/sdk/ANBannerAdView.h @@ -50,7 +50,7 @@ the example above to set the banner ad view's controller to your own view controller implementation. */ -@property (nonatomic, readwrite, assign) UIViewController *rootViewController; +@property (nonatomic, readwrite, weak) UIViewController *rootViewController; /** Represents the width and height of the ad view. In order for ads From 4e176fd2e458ba15e5581a0f33b67afad0dd754e Mon Sep 17 00:00:00 2001 From: Mark Ha Date: Mon, 17 Mar 2014 17:44:48 -0400 Subject: [PATCH 3/4] MS-604 Validate MRAID properties --- sdk/Resources/MRAID.bundle/mraid.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/sdk/Resources/MRAID.bundle/mraid.js b/sdk/Resources/MRAID.bundle/mraid.js index 75d4a3d47..a741eb4e5 100644 --- a/sdk/Resources/MRAID.bundle/mraid.js +++ b/sdk/Resources/MRAID.bundle/mraid.js @@ -166,10 +166,10 @@ mraid.util.errorEvent("Invalid expandProperties. Retaining default values.", "mraid.setExpandProperties()"); return; } - if (typeof properties.width === "undefined") { + if (typeof properties.width !== "number") { properties.width = -1; } - if (typeof properties.height === "undefined") { + if (typeof properties.height !== "number") { properties.height = -1; } if (properties.useCustomClose === true) { @@ -186,13 +186,6 @@ return expand_properties; }; - // Takes a boolean - mraid.useCustomClose=function(well_is_it){ - ep = mraid.getExpandProperties(); - ep.useCustomClose = well_is_it; - mraid.setExpandProperties(ep); - }; - // Loads a given URL (TODO make this native ) mraid.open=function(url){ mraid.util.nativeCall("mraid://open/?uri="+encodeURIComponent(url)); @@ -428,7 +421,7 @@ mraid.util.errorEvent("Invalid resizeProperties", callingFunctionName); return false; } - if (typeof properties.width === "undefined" || typeof properties.height === "undefined" || typeof properties.offsetX === "undefined" || typeof properties.offsetY === "undefined") { + if (typeof properties.width !== "number" || typeof properties.height !== "number" || typeof properties.offsetX !== "number" || typeof properties.offsetY !== "number") { mraid.util.errorEvent("Incomplete resizeProperties. width, height, offsetX, offsetY required", callingFunctionName); return false; } From 5b728155dc5dfc2bc0e90b69b73e6ac15b1067b2 Mon Sep 17 00:00:00 2001 From: Jose Cabal-Ugaz Date: Mon, 24 Mar 2014 10:47:03 -0400 Subject: [PATCH 4/4] SDK Release 1.13 --- sdk/internal/ANGlobal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/internal/ANGlobal.h b/sdk/internal/ANGlobal.h index 523ec0f1b..dcddcddca 100644 --- a/sdk/internal/ANGlobal.h +++ b/sdk/internal/ANGlobal.h @@ -23,7 +23,7 @@ #define AN_RESOURCE_BUNDLE @"ANSDKResources" #define AN_DEFAULT_PLACEMENT_ID @"default_placement_id" -#define AN_SDK_VERSION @"1.12" +#define AN_SDK_VERSION @"1.13" #define APPNEXUS_BANNER_SIZE CGSizeMake(320, 50) #define APPNEXUS_MEDIUM_RECT_SIZE CGSizeMake(300, 250)