diff --git a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m index e01a34d..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 { 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; 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 diff --git a/MVMCore/MVMCore/Models/JSON/JSONValue.swift b/MVMCore/MVMCore/Models/JSON/JSONValue.swift index fcb50fd..a603d23 100644 --- a/MVMCore/MVMCore/Models/JSON/JSONValue.swift +++ b/MVMCore/MVMCore/Models/JSON/JSONValue.swift @@ -72,7 +72,7 @@ public enum JSONValue: Codable, Equatable { public func ==(lhs: JSONValue, rhs: JSONValue) -> Bool { let ld = try? lhs.encode() - let rd = try? lhs.encode() + let rd = try? rhs.encode() return ld == rd }