From 4def5e724aac712bf56bdb98e4a7901fc001b706 Mon Sep 17 00:00:00 2001 From: Damodaram Date: Mon, 14 Sep 2020 17:31:44 +0530 Subject: [PATCH 1/3] added noop Action type --- MVMCore/MVMCore.xcodeproj/project.pbxproj | 4 +++ .../ActionHandling/MVMCoreActionHandler.m | 2 ++ .../MVMCore/Constants/MVMCoreJSONConstants.m | 1 + .../Models/ActionType/ActionNoopModel.swift | 27 +++++++++++++++++++ MVMCore/MVMCore/Models/ModelMapping.swift | 1 + 5 files changed, 35 insertions(+) create mode 100644 MVMCore/MVMCore/Models/ActionType/ActionNoopModel.swift diff --git a/MVMCore/MVMCore.xcodeproj/project.pbxproj b/MVMCore/MVMCore.xcodeproj/project.pbxproj index d22f12c..28dcf0f 100644 --- a/MVMCore/MVMCore.xcodeproj/project.pbxproj +++ b/MVMCore/MVMCore.xcodeproj/project.pbxproj @@ -155,6 +155,7 @@ AFFCFA661FCCC0D700FD0730 /* MVMCoreLoadingOverlayHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = AFFCFA621FCCC0D600FD0730 /* MVMCoreLoadingOverlayHandler.h */; settings = {ATTRIBUTES = (Public, ); }; }; AFFCFA671FCCC0D700FD0730 /* MVMCoreLoadingOverlayHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = AFFCFA631FCCC0D600FD0730 /* MVMCoreLoadingOverlayHandler.m */; }; AFFCFA681FCCC0D700FD0730 /* MVMCoreLoadingViewControllerProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFFCFA641FCCC0D600FD0730 /* MVMCoreLoadingViewControllerProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + BB780ADF250F8C890030BD2F /* ActionNoopModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB780ADE250F8C890030BD2F /* ActionNoopModel.swift */; }; D282AAB62240085300C46919 /* MVMCoreGetterUtility+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D282AAB52240085300C46919 /* MVMCoreGetterUtility+Extension.swift */; }; D282AAB82240342D00C46919 /* NSNumber+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D282AAB72240342D00C46919 /* NSNumber+Extension.swift */; }; D2DEDCB723C63F3B00C44CC4 /* Clamping.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2DEDCB623C63F3B00C44CC4 /* Clamping.swift */; }; @@ -306,6 +307,7 @@ AFFCFA621FCCC0D600FD0730 /* MVMCoreLoadingOverlayHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreLoadingOverlayHandler.h; sourceTree = ""; }; AFFCFA631FCCC0D600FD0730 /* MVMCoreLoadingOverlayHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreLoadingOverlayHandler.m; sourceTree = ""; }; AFFCFA641FCCC0D600FD0730 /* MVMCoreLoadingViewControllerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreLoadingViewControllerProtocol.h; sourceTree = ""; }; + BB780ADE250F8C890030BD2F /* ActionNoopModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionNoopModel.swift; sourceTree = ""; }; D282AAB52240085300C46919 /* MVMCoreGetterUtility+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MVMCoreGetterUtility+Extension.swift"; sourceTree = ""; }; D282AAB72240342D00C46919 /* NSNumber+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSNumber+Extension.swift"; sourceTree = ""; }; D2DEDCB623C63F3B00C44CC4 /* Clamping.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Clamping.swift; sourceTree = ""; }; @@ -467,6 +469,7 @@ 94C014D2242119E6005811A9 /* ActionPreviousSubmitModel.swift */, 94C014D424211AF0005811A9 /* ActionCancelModel.swift */, 94C014D824212360005811A9 /* ActionSettingModel.swift */, + BB780ADE250F8C890030BD2F /* ActionNoopModel.swift */, 0184D3FE24BE554A00A05369 /* AlertModel.swift */, ); path = ActionType; @@ -867,6 +870,7 @@ AFBB96641FBA3A570008D868 /* MVMCoreLoadHandler.m in Sources */, AFFCFA671FCCC0D700FD0730 /* MVMCoreLoadingOverlayHandler.m in Sources */, AFBB968E1FBA3A9A0008D868 /* MVMCoreNavigationHandler.m in Sources */, + BB780ADF250F8C890030BD2F /* ActionNoopModel.swift in Sources */, D2E1FAD92260C3E400AEFD8C /* DelegateObject.swift in Sources */, 01F2A03623A80A7300D954D8 /* ActionModelProtocol.swift in Sources */, AFBB96991FBA3A9A0008D868 /* MVMCoreAlertController.m in Sources */, diff --git a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m index 44f5851..8b2beac 100644 --- a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m +++ b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m @@ -94,6 +94,8 @@ NSString * const KeyActionTypeOpen = @"openPage"; } else if ([actionType isEqualToString:KeyActionTypeAlert]) { [self showAlert:actionInformation additionalData:additionalData delegateObject:delegateObject]; + } else if ([actionType isEqualToString:KeyActionTypeNoop]){ + // Need to tag analytics data } else if (![self handleOtherActions:actionType actionInformation:actionInformation additionalData:additionalData delegateObject:delegateObject]) { // not a known action type. [self unknownAction:actionType actionInformation:actionInformation additionalData:additionalData delegateObject:delegateObject]; diff --git a/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.m b/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.m index c283fd6..80122db 100644 --- a/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.m +++ b/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.m @@ -42,6 +42,7 @@ NSString * const KeyActionTypeTopAlert = @"topAlert"; NSString * const KeyActionTypeSettings = @"openSettings"; NSString * const KeyActionTypeCollapseNotification = @"collapseNotification"; NSString * const KeyActionTypeAlert = @"alert"; +NSString * const KeyActionTypeNoop = @"noop"; NSString * const KeyActionInformation = @"actionInformation"; NSString * const KeyLinkAwayAppURL = @"appURL"; NSString * const KeyLinkAwayURL = @"browserUrl"; diff --git a/MVMCore/MVMCore/Models/ActionType/ActionNoopModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionNoopModel.swift new file mode 100644 index 0000000..25f3ded --- /dev/null +++ b/MVMCore/MVMCore/Models/ActionType/ActionNoopModel.swift @@ -0,0 +1,27 @@ +// +// ActionNoopModel.swift +// MVMCore +// +// Created by Dhamodaram Nandi on 14/09/20. +// Copyright © 2020 myverizon. All rights reserved. +// + +@objcMembers public class ActionNoopModel: ActionModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + + public static var identifier: String = "noop" + public var actionType: String = ActionNoopModel.identifier + public var extraParameters: JSONValueDictionary? + public var analyticsData: JSONValueDictionary? + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(_ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) { + self.extraParameters = extraParameters + self.analyticsData = analyticsData + } +} diff --git a/MVMCore/MVMCore/Models/ModelMapping.swift b/MVMCore/MVMCore/Models/ModelMapping.swift index 66fdab0..21ff0c1 100644 --- a/MVMCore/MVMCore/Models/ModelMapping.swift +++ b/MVMCore/MVMCore/Models/ModelMapping.swift @@ -22,5 +22,6 @@ import Foundation try? ModelRegistry.register(ActionCancelModel.self) try? ModelRegistry.register(ActionSettingModel.self) try? ModelRegistry.register(ActionAlertModel.self) + try? ModelRegistry.register(ActionNoopModel.self) } } From 30aa2093576b58a342de5776f3fb7364def36657 Mon Sep 17 00:00:00 2001 From: Damodaram Date: Mon, 14 Sep 2020 18:08:00 +0530 Subject: [PATCH 2/3] added Constant --- MVMCore/MVMCore/Constants/MVMCoreJSONConstants.h | 1 + 1 file changed, 1 insertion(+) diff --git a/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.h b/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.h index 697374c..da64130 100644 --- a/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.h +++ b/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.h @@ -42,6 +42,7 @@ extern NSString * const KeyActionTypeTopAlert; extern NSString * const KeyActionTypeSettings; extern NSString * const KeyActionTypeCollapseNotification; extern NSString * const KeyActionTypeAlert; +extern NSString * const KeyActionTypeNoop; extern NSString * const KeyActionInformation; extern NSString * const KeyLinkAwayAppURL; extern NSString * const KeyLinkAwayURL; From 881f1276ec95c724cfa7960d17bb3953d9729f6f Mon Sep 17 00:00:00 2001 From: Damodaram Date: Mon, 14 Sep 2020 21:12:56 +0530 Subject: [PATCH 3/3] removed comment --- MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m | 1 - 1 file changed, 1 deletion(-) diff --git a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m index 8b2beac..b03dcc4 100644 --- a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m +++ b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m @@ -95,7 +95,6 @@ NSString * const KeyActionTypeOpen = @"openPage"; [self showAlert:actionInformation additionalData:additionalData delegateObject:delegateObject]; } else if ([actionType isEqualToString:KeyActionTypeNoop]){ - // Need to tag analytics data } else if (![self handleOtherActions:actionType actionInformation:actionInformation additionalData:additionalData delegateObject:delegateObject]) { // not a known action type. [self unknownAction:actionType actionInformation:actionInformation additionalData:additionalData delegateObject:delegateObject];