From c938d03cc6c2a41d8ad9ebed5cb257b9d1066bb7 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Mon, 6 Aug 2018 15:31:59 -0400 Subject: [PATCH 1/2] Add capability to exclude initial parameters. --- .DS_Store | Bin 6148 -> 0 bytes MVMCore/MVMCore.xcodeproj/project.pbxproj | 1 + .../MVMCore/LoadHandling/MVMCoreLoadHandler.m | 2 +- .../LoadHandling/MVMCoreRequestParameters.h | 5 ++++- .../LoadHandling/MVMCoreRequestParameters.m | 1 + MVMCore/MVMCore/Session/MVMCoreSessionObject.h | 2 ++ MVMCore/MVMCore/Session/MVMCoreSessionObject.m | 4 ++++ 7 files changed, 13 insertions(+), 2 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 73e14d7a1d2b81da21dbcb48c5f87382bcce3744..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKJx{|h5PgP9RATAKn16s6*chS`Hp)@~BT!nZiX^R?4~Z>5opAWWO(1uy|HW)loD7%*`UhK`JUObnW1i#=AmdU4xS1Bw2kOZI+(86McK z@ooS0o{=luqr!@BRpA^TctMFZYHV=Hc}DWd!d^a^K2)}!Wm*Li`K@h2?FY1wkd zcH|Yr1@q+ey%FUJHF+EQCC|{V?wU$>^<%$>+;+Y%^KH3igujcME8q&a0l0VN6>tUOw_`#f%3YhVJ+p}kuag0do<{ diff --git a/MVMCore/MVMCore.xcodeproj/project.pbxproj b/MVMCore/MVMCore.xcodeproj/project.pbxproj index a5c1c08..b73a67e 100644 --- a/MVMCore/MVMCore.xcodeproj/project.pbxproj +++ b/MVMCore/MVMCore.xcodeproj/project.pbxproj @@ -959,6 +959,7 @@ "$(PROJECT_DIR)/MVMCore/EmbeddedLibaries/AdobeMobileLibrary", "$(PROJECT_DIR)/MVMCore/EmbeddedLibraries/VZAnalytics", ); + ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.vzw.MVMCore; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m index f619c83..a3b244e 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m @@ -165,7 +165,7 @@ // Sets up the Initial parameters. if (requestParameters.addInitialRequestParameters) { - NSDictionary *initialParameters = [[MVMCoreSessionObject sharedGlobal] getInitialParameters]; + NSDictionary *initialParameters = [[MVMCoreSessionObject sharedGlobal] getInitialParametersExcludingSections:requestParameters.excludedInitialParameters]; if (initialParameters) { [parameters setObject:initialParameters forKey:@"InitialParams"]; } diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h index 315c521..b9b17c1 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h @@ -63,6 +63,9 @@ typedef NS_ENUM(NSInteger, MFLoadStyle) { // A flag for if we should be adding the initial request parameters. @property (assign, nonatomic) BOOL addInitialRequestParameters; +// A list of initial parameter sections to blacklist / skip. +@property (nullable, strong, nonatomic) NSArray *excludedInitialParameters; + // A flag for if we should always show alerts, even during a background load. @property (assign) BOOL allowAlertsIfBackgroundRequest; @@ -88,7 +91,7 @@ typedef NS_ENUM(NSInteger, MFLoadStyle) { @property (nonatomic) BOOL openSupportPanel; // A list of page types that this operation should NOT be loaded in parallel with. -@property (nonatomic) NSArray* _Nullable successivePageTypes; +@property (nullable, strong, nonatomic) NSArray * successivePageTypes; // Creates an object with the given page type and extra parameters. Adds the extra parameters to the standard request parameters. Will add any modules needed by the page type by default. - (nullable instancetype)initWithPageType:(nonnull NSString *)pageType extraParameters:(nullable NSDictionary *)extraParameters; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m index 70bb74c..8524bf3 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.m @@ -125,6 +125,7 @@ copyObject.shouldNotGoToServerOnCacheFail = self.shouldNotGoToServerOnCacheFail; copyObject.neverLoadFromCache = self.neverLoadFromCache; copyObject.addInitialRequestParameters = self.addInitialRequestParameters; + copyObject.excludedInitialParameters = self.excludedInitialParameters; copyObject.tabWasPressed = self.tabWasPressed; copyObject.navigationController = self.navigationController; copyObject.allowAlertsIfBackgroundRequest = self.allowAlertsIfBackgroundRequest; diff --git a/MVMCore/MVMCore/Session/MVMCoreSessionObject.h b/MVMCore/MVMCore/Session/MVMCoreSessionObject.h index 04f64ad..9b5f2ae 100644 --- a/MVMCore/MVMCore/Session/MVMCoreSessionObject.h +++ b/MVMCore/MVMCore/Session/MVMCoreSessionObject.h @@ -28,6 +28,8 @@ // Gets inital parameters for request parameters. - (nullable NSDictionary *)getInitialParameters; +// Gets inital parameters for request parameters excluding any items given a list of key names. +- (nullable NSDictionary *)getInitialParametersExcludingSections:(nullable NSArray *)excludeSections; // Restarts the application session state. Can clear variables and pass a page type if needed. - (void)restartSessionWithPageType:(nullable NSString *)pageType parameters:(nullable NSDictionary *)parameters clearAllVariables:(BOOL)clearAllVariables; diff --git a/MVMCore/MVMCore/Session/MVMCoreSessionObject.m b/MVMCore/MVMCore/Session/MVMCoreSessionObject.m index 343afbb..57813ac 100644 --- a/MVMCore/MVMCore/Session/MVMCoreSessionObject.m +++ b/MVMCore/MVMCore/Session/MVMCoreSessionObject.m @@ -16,6 +16,10 @@ } - (nullable NSDictionary *)getInitialParameters { + return [self getInitialParametersExcludingSections:nil]; +} + +- (nullable NSDictionary *)getInitialParametersExcludingSections:(nullable NSArray *)excludeSections { return nil; } From 6c177efd8f9ebcc553ac7908646fdf41efb05c87 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Wed, 8 Aug 2018 18:21:35 -0400 Subject: [PATCH 2/2] Switch to using NSSet to satisfy PR. --- MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h | 2 +- MVMCore/MVMCore/Session/MVMCoreSessionObject.h | 2 +- MVMCore/MVMCore/Session/MVMCoreSessionObject.m | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h index b9b17c1..b53ae9d 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreRequestParameters.h @@ -64,7 +64,7 @@ typedef NS_ENUM(NSInteger, MFLoadStyle) { @property (assign, nonatomic) BOOL addInitialRequestParameters; // A list of initial parameter sections to blacklist / skip. -@property (nullable, strong, nonatomic) NSArray *excludedInitialParameters; +@property (nullable, strong, nonatomic) NSSet *excludedInitialParameters; // A flag for if we should always show alerts, even during a background load. @property (assign) BOOL allowAlertsIfBackgroundRequest; diff --git a/MVMCore/MVMCore/Session/MVMCoreSessionObject.h b/MVMCore/MVMCore/Session/MVMCoreSessionObject.h index 9b5f2ae..c2a85e6 100644 --- a/MVMCore/MVMCore/Session/MVMCoreSessionObject.h +++ b/MVMCore/MVMCore/Session/MVMCoreSessionObject.h @@ -29,7 +29,7 @@ // Gets inital parameters for request parameters. - (nullable NSDictionary *)getInitialParameters; // Gets inital parameters for request parameters excluding any items given a list of key names. -- (nullable NSDictionary *)getInitialParametersExcludingSections:(nullable NSArray *)excludeSections; +- (nullable NSDictionary *)getInitialParametersExcludingSections:(nullable NSSet *)excludeSections; // Restarts the application session state. Can clear variables and pass a page type if needed. - (void)restartSessionWithPageType:(nullable NSString *)pageType parameters:(nullable NSDictionary *)parameters clearAllVariables:(BOOL)clearAllVariables; diff --git a/MVMCore/MVMCore/Session/MVMCoreSessionObject.m b/MVMCore/MVMCore/Session/MVMCoreSessionObject.m index 57813ac..b49132d 100644 --- a/MVMCore/MVMCore/Session/MVMCoreSessionObject.m +++ b/MVMCore/MVMCore/Session/MVMCoreSessionObject.m @@ -19,7 +19,7 @@ return [self getInitialParametersExcludingSections:nil]; } -- (nullable NSDictionary *)getInitialParametersExcludingSections:(nullable NSArray *)excludeSections { +- (nullable NSDictionary *)getInitialParametersExcludingSections:(nullable NSSet *)excludeSections { return nil; }