From 6ca805a95015b4419ee68e8b2cca5d7895206df0 Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Fri, 6 Mar 2020 17:37:23 -0500 Subject: [PATCH 1/6] comment == temporarily --- MVMCore/MVMCore/Models/JSON/JSONValue.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MVMCore/MVMCore/Models/JSON/JSONValue.swift b/MVMCore/MVMCore/Models/JSON/JSONValue.swift index fcb50fd..4c44839 100644 --- a/MVMCore/MVMCore/Models/JSON/JSONValue.swift +++ b/MVMCore/MVMCore/Models/JSON/JSONValue.swift @@ -70,11 +70,11 @@ public enum JSONValue: Codable, Equatable { } } -public func ==(lhs: JSONValue, rhs: JSONValue) -> Bool { - let ld = try? lhs.encode() - let rd = try? lhs.encode() - return ld == rd -} +//public func ==(lhs: JSONValue, rhs: JSONValue) -> Bool { +// let ld = try! lhs.encode() +// let rd = try! lhs.encode() +// return ld == rd +//} extension JSONValue: ExpressibleByStringLiteral { public init(stringLiteral value: String) { From 1eda14b2efb233ce2bdfa7a31c663d6d7be25c3e Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 13 Mar 2020 10:04:47 -0400 Subject: [PATCH 2/6] swift --- .../MainProtocols/MVMCoreViewManagerViewControllerProtocol.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCore/MVMCore/MainProtocols/MVMCoreViewManagerViewControllerProtocol.h b/MVMCore/MVMCore/MainProtocols/MVMCoreViewManagerViewControllerProtocol.h index 70b8c4b..ff48b90 100644 --- a/MVMCore/MVMCore/MainProtocols/MVMCoreViewManagerViewControllerProtocol.h +++ b/MVMCore/MVMCore/MainProtocols/MVMCoreViewManagerViewControllerProtocol.h @@ -17,10 +17,10 @@ @property (nullable, weak, nonatomic) UIViewController *manager; // Notifies the view controller that it can be ready (usually means that it's committed to the screen). -- (void)viewControllerReadyInManager:(nonnull NSObject *)manager; +- (void)viewControllerReadyInManager:(nonnull UIViewController *)manager; // Notifies the current showing view controller that the manager is disappearing. -- (void)managerWillDisappear:(nonnull NSObject *)manager; +- (void)managerWillDisappear:(nonnull UIViewController *)manager; // Manager can check if the view controller does not want to be cached. You should be following proper caching techniques (caching, updating when needed, deleting when needed), so this should be a last resort. - (BOOL)shouldCacheInManager; From 9b2812bc39343be9bb4efca35b2e7dd8203ff147 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 18 Mar 2020 13:28:51 -0400 Subject: [PATCH 3/6] remove unnecessary settings check --- .../ActionHandling/MVMCoreActionHandler.m | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m index 2b046df..8eff939 100644 --- a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m +++ b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m @@ -300,15 +300,7 @@ NSString * const KeyActionTypeOpen = @"openPage"; } - (void)settingsAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject { - // Opens the settings. - NSString *type = [actionInformation string:KeyPageType]; - if ([@"location" isEqualToString:type] || [@"push" isEqualToString:type]) { - [MVMCoreActionUtility linkAway:UIApplicationOpenSettingsURLString appURLString:nil]; - } else { - // No known settings type - MVMCoreErrorObject *error = [[MVMCoreErrorObject alloc] initWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess] code:ErrorCodeInvalidSettingType domain:ErrorDomainNative location:[NSString stringWithFormat:@"%@_%@",NSStringFromClass([delegateObject.actionDelegate class]),KeyActionTypeSettings]]; - [self handleActionError:error actionInformation:actionInformation additionalData:additionalData delegateObject:delegateObject]; - } + [MVMCoreActionUtility linkAway:UIApplicationOpenSettingsURLString appURLString:nil]; } - (void)collapseNotificationAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject { @@ -640,14 +632,7 @@ NSString * const KeyActionTypeOpen = @"openPage"; - (void)settingsAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject *)delegate { // Opens the settings. - NSString *type = [actionInformation string:KeyPageType]; - if ([@"location" isEqualToString:type] || [@"push" isEqualToString:type]) { - [MVMCoreActionUtility linkAway:UIApplicationOpenSettingsURLString appURLString:nil]; - } else { - // No known settings type - MVMCoreErrorObject *error = [[MVMCoreErrorObject alloc] initWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess] code:ErrorCodeInvalidSettingType domain:ErrorDomainNative location:[NSString stringWithFormat:@"%@_%@",NSStringFromClass([delegate class]),KeyActionTypeSettings]]; - [self handleActionError:error actionInformation:actionInformation additionalData:additionalData delegate:delegate]; - } + [MVMCoreActionUtility linkAway:UIApplicationOpenSettingsURLString appURLString:nil]; } - (void)collapseNotificationAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject *)delegate { From 8da16fe18bd3b8cb7a526db2081362df388d1c86 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 19 Mar 2020 16:28:35 -0400 Subject: [PATCH 4/6] required identifiers --- MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift | 2 +- MVMCore/MVMCore/Models/ActionType/ActionCallModel.swift | 2 +- MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift | 2 +- MVMCore/MVMCore/Models/ActionType/ActionModelProtocol.swift | 4 ++-- MVMCore/MVMCore/Models/ActionType/ActionOpenAppModel.swift | 2 +- MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift | 2 +- MVMCore/MVMCore/Models/ActionType/ActionOpenUrlModel.swift | 2 +- MVMCore/MVMCore/Models/ActionType/ActionPopupModel.swift | 2 +- .../MVMCore/Models/ActionType/ActionPreviousSubmitModel.swift | 2 +- MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift | 2 +- MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift | 2 +- MVMCore/MVMCore/Models/ActionType/ActionShareModel.swift | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift index 7c903ff..72b84f7 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionBackModel.swift @@ -10,7 +10,7 @@ import Foundation @objcMembers public class ActionBackModel: ActionModelProtocol { public static var identifier: String = "back" - public var actionType: String? + public var actionType: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? // Temporary fix till server changes diff --git a/MVMCore/MVMCore/Models/ActionType/ActionCallModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionCallModel.swift index e0b431b..3f13e6a 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionCallModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionCallModel.swift @@ -10,7 +10,7 @@ import Foundation @objcMembers public class ActionCallModel: ActionModelProtocol { public static var identifier: String = "call" - public var actionType: String? + public var actionType: String = ActionCallModel.identifier // TODO: decode into phone number once action handler is re-written public var callNumber: String public var extraParameters: JSONValueDictionary? diff --git a/MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift index bf208f4..08bf63c 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift @@ -10,7 +10,7 @@ import UIKit @objcMembers public class ActionCancelModel: ActionModelProtocol { public static var identifier: String = "cancel" - public var actionType: String? + public var actionType: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? public var title: String? diff --git a/MVMCore/MVMCore/Models/ActionType/ActionModelProtocol.swift b/MVMCore/MVMCore/Models/ActionType/ActionModelProtocol.swift index 29120da..dc36409 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionModelProtocol.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionModelProtocol.swift @@ -10,7 +10,7 @@ import Foundation public protocol ActionModelProtocol: ModelProtocol { - var actionType: String? { get } + var actionType: String { get } var extraParameters: JSONValueDictionary? { get set } var analyticsData: JSONValueDictionary? { get set } @@ -20,7 +20,7 @@ public protocol ActionModelProtocol: ModelProtocol { public extension ActionModelProtocol { - var actionType: String? { + var actionType: String { get { return Self.identifier } } diff --git a/MVMCore/MVMCore/Models/ActionType/ActionOpenAppModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionOpenAppModel.swift index 674d313..9614bc8 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionOpenAppModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionOpenAppModel.swift @@ -10,7 +10,7 @@ import Foundation @objcMembers public class ActionOpenAppModel: ActionModelProtocol { public static var identifier: String = "openApp" - public var actionType: String? + public var actionType: String = ActionOpenAppModel.identifier // TODO: decode into url once action handler is re-written public var appURL: String public var extraParameters: JSONValueDictionary? diff --git a/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift index 0675684..413adf8 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionOpenPageModel.swift @@ -10,7 +10,7 @@ import Foundation @objcMembers public class ActionOpenPageModel: ActionModelProtocol { public static var identifier: String = "openPage" - public var actionType: String? + public var actionType: String = ActionOpenPageModel.identifier public var pageType: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? diff --git a/MVMCore/MVMCore/Models/ActionType/ActionOpenUrlModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionOpenUrlModel.swift index fb13643..fc8c11f 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionOpenUrlModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionOpenUrlModel.swift @@ -10,7 +10,7 @@ import Foundation @objcMembers public class ActionOpenUrlModel: ActionModelProtocol { public static var identifier: String = "openURL" - public var actionType: String? + public var actionType: String = ActionOpenUrlModel.identifier // TODO: decode into url once action handler is re-written public var browserUrl: String public var extraParameters: JSONValueDictionary? diff --git a/MVMCore/MVMCore/Models/ActionType/ActionPopupModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionPopupModel.swift index 899f782..eaff84c 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionPopupModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionPopupModel.swift @@ -10,7 +10,7 @@ import Foundation @objcMembers public class ActionPopupModel: ActionModelProtocol { public static var identifier: String = "popup" - public var actionType: String? + public var actionType: String = ActionPopupModel.identifier public var title: String? public var pageType: String public var extraParameters: JSONValueDictionary? diff --git a/MVMCore/MVMCore/Models/ActionType/ActionPreviousSubmitModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionPreviousSubmitModel.swift index 151ee51..f6d5ad7 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionPreviousSubmitModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionPreviousSubmitModel.swift @@ -10,7 +10,7 @@ import UIKit @objcMembers public class ActionPreviousSubmitModel: ActionModelProtocol { public static var identifier: String = "previousSubmit" - public var actionType: String? + public var actionType: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? public var title: String? diff --git a/MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift index e524c66..0cdbae3 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift @@ -10,7 +10,7 @@ import UIKit @objcMembers public class ActionRestartModel: ActionModelProtocol { public static var identifier: String = "restart" - public var actionType: String? + public var actionType: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? public var title: String? diff --git a/MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift index cfc2c36..212b526 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift @@ -10,7 +10,7 @@ import UIKit @objcMembers public class ActionSettingModel: ActionModelProtocol { public static var identifier: String = "openSettings" - public var actionType: String? + public var actionType: String public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? public var title: String? diff --git a/MVMCore/MVMCore/Models/ActionType/ActionShareModel.swift b/MVMCore/MVMCore/Models/ActionType/ActionShareModel.swift index c40fbcd..16da245 100644 --- a/MVMCore/MVMCore/Models/ActionType/ActionShareModel.swift +++ b/MVMCore/MVMCore/Models/ActionType/ActionShareModel.swift @@ -15,7 +15,7 @@ import UIKit public static var identifier: String = "share" - public var actionType: String? + public var actionType: String = ActionShareModel.identifier public var title: String? public var sharedType: String public var sharedText: String From fa48923e1fd251a43267c47f77eacd547a8b9c33 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 20 Mar 2020 10:20:01 -0400 Subject: [PATCH 5/6] remove comment out --- MVMCore/MVMCore/Models/JSON/JSONValue.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MVMCore/MVMCore/Models/JSON/JSONValue.swift b/MVMCore/MVMCore/Models/JSON/JSONValue.swift index 4c44839..25474eb 100644 --- a/MVMCore/MVMCore/Models/JSON/JSONValue.swift +++ b/MVMCore/MVMCore/Models/JSON/JSONValue.swift @@ -70,11 +70,11 @@ public enum JSONValue: Codable, Equatable { } } -//public func ==(lhs: JSONValue, rhs: JSONValue) -> Bool { -// let ld = try! lhs.encode() -// let rd = try! lhs.encode() -// return ld == rd -//} +public func ==(lhs: JSONValue, rhs: JSONValue) -> Bool { + let ld = try! lhs.encode() + let rd = try! rhs.encode() + return ld == rd +} extension JSONValue: ExpressibleByStringLiteral { public init(stringLiteral value: String) { From bab662149201a83fa350622f5e08d9348b80e7a3 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 20 Mar 2020 10:21:06 -0400 Subject: [PATCH 6/6] remove change --- MVMCore/MVMCore/Models/JSON/JSONValue.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCore/MVMCore/Models/JSON/JSONValue.swift b/MVMCore/MVMCore/Models/JSON/JSONValue.swift index 25474eb..a603d23 100644 --- a/MVMCore/MVMCore/Models/JSON/JSONValue.swift +++ b/MVMCore/MVMCore/Models/JSON/JSONValue.swift @@ -71,8 +71,8 @@ public enum JSONValue: Codable, Equatable { } public func ==(lhs: JSONValue, rhs: JSONValue) -> Bool { - let ld = try! lhs.encode() - let rd = try! rhs.encode() + let ld = try? lhs.encode() + let rd = try? rhs.encode() return ld == rd }