diff --git a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.h b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.h index 74b93a4..e4b169d 100644 --- a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.h +++ b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.h @@ -56,9 +56,6 @@ extern NSString * _Nonnull const KeyActionTypeOpen; // Shows popup alert from the alert object in the action map. The actionType of the action is 'alert' - (void)showAlert:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject; -// Shows a top alert -- (void)topAlertAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject; - // Redirects to another experience - (void)redirectAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject; @@ -68,9 +65,6 @@ extern NSString * _Nonnull const KeyActionTypeOpen; // Goes to settings app - (void)settingsAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject; -// Collapses the current top notification -- (void)collapseNotificationAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject; - // Subclass this to handle other custom actions. Return YES if handled, and NO if not. - (BOOL)handleOtherActions:(nullable NSString *)actionType actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject; diff --git a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m index b03dcc4..f5b3807 100644 --- a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m +++ b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m @@ -290,13 +290,6 @@ NSString * const KeyActionTypeOpen = @"openPage"; [MVMCoreActionUtility linkAway:UIApplicationOpenSettingsURLString appURLString:nil]; } -- (void)collapseNotificationAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject { - // Collapse the current notification. - if ([[MVMCoreObject sharedInstance].globalTopAlertDelegate respondsToSelector:@selector(getTopAlertView)]) { - [[[MVMCoreObject sharedInstance].globalTopAlertDelegate getTopAlertView] collapseNotification]; - } -} - - (void)showAlert:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject { MVMCoreErrorObject *error = nil; @@ -469,16 +462,12 @@ NSString * const KeyActionTypeOpen = @"openPage"; [self previousSubmitAction:actionInformation additionalData:additionalData delegate:delegate]; } else if ([actionType isEqualToString:KeyActionTypePopup]) { [self popupAction:actionInformation additionalData:additionalData delegate:delegate]; - } else if ([actionType isEqualToString:KeyActionTypeTopAlert]) { - [self topAlertAction:actionInformation additionalData:additionalData delegate:delegate]; } else if ([actionType isEqualToString:KeyActionTypeRedirect]) { [self redirectAction:actionInformation additionalData:additionalData delegate:delegate]; } else if ([actionType isEqualToString:KeyActionTypeCancel]) { [self cancelAction:actionInformation additionalData:additionalData delegate:delegate]; } else if ([actionType isEqualToString:KeyActionTypeSettings]) { [self settingsAction:actionInformation additionalData:additionalData delegate:delegate]; - } else if ([actionType isEqualToString:KeyActionTypeCollapseNotification]) { - [self collapseNotificationAction:actionInformation additionalData:additionalData delegate:delegate]; } else if (![self handleOtherActions:actionType actionInformation:actionInformation additionalData:additionalData delegate:delegate]) { // not a known action type. [self unknownAction:actionType actionInformation:actionInformation additionalData:additionalData delegate:delegate]; @@ -591,22 +580,6 @@ NSString * const KeyActionTypeOpen = @"openPage"; }]; } -- (void)topAlertAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject *)delegate { - // Perform a top alert. - NSString *pageTypeForTopAlert = [actionInformation stringForKey:KeyPageType]; - [[MVMCoreCache sharedCache] fetchJSONForPageType:pageTypeForTopAlert queue:nil waitUntilFinished:YES completionHandler:^(NSDictionary * _Nullable jsonDictionary) { - - NSDictionary *responseInfo = [jsonDictionary dict:KeyResponseInfo]; - if (responseInfo) { - MVMCoreAlertObject *alertObject = [MVMCoreAlertObject alertObjectForPageType:pageTypeForTopAlert responseInfo:responseInfo additionalData:additionalData actionDelegate:delegate]; - if ([delegate respondsToSelector:@selector(willShowTopAlertWithAlertObject:alertJson:)]) { - alertObject = [delegate willShowTopAlertWithAlertObject:alertObject alertJson:jsonDictionary]; - } - [alertObject showAlert]; - } - }]; -} - - (void)redirectAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject *)delegate { // Have delegate redirect. [[MVMCoreSessionObject sharedGlobal] redirectWithInfo:actionInformation]; diff --git a/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.h b/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.h index da64130..ee8d4b4 100644 --- a/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.h +++ b/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.h @@ -38,9 +38,7 @@ extern NSString * const KeyActionTypePreviousSubmit; extern NSString * const KeyActionTypePopup; extern NSString * const KeyActionTypeCancel; extern NSString * const KeyActionTypeRedirect; -extern NSString * const KeyActionTypeTopAlert; extern NSString * const KeyActionTypeSettings; -extern NSString * const KeyActionTypeCollapseNotification; extern NSString * const KeyActionTypeAlert; extern NSString * const KeyActionTypeNoop; extern NSString * const KeyActionInformation; diff --git a/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.m b/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.m index 80122db..91ed8a3 100644 --- a/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.m +++ b/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.m @@ -38,9 +38,7 @@ NSString * const KeyActionTypePreviousSubmit = @"previousSubmit"; NSString * const KeyActionTypePopup = @"popup"; NSString * const KeyActionTypeCancel = @"cancel"; NSString * const KeyActionTypeRedirect = @"switchApp"; -NSString * const KeyActionTypeTopAlert = @"topAlert"; NSString * const KeyActionTypeSettings = @"openSettings"; -NSString * const KeyActionTypeCollapseNotification = @"collapseNotification"; NSString * const KeyActionTypeAlert = @"alert"; NSString * const KeyActionTypeNoop = @"noop"; NSString * const KeyActionInformation = @"actionInformation"; diff --git a/MVMCore/MVMCore/MVMCore.h b/MVMCore/MVMCore/MVMCore.h index f5636b3..b0b0cbb 100644 --- a/MVMCore/MVMCore/MVMCore.h +++ b/MVMCore/MVMCore/MVMCore.h @@ -56,13 +56,8 @@ FOUNDATION_EXPORT const unsigned char MVMCoreVersionString[]; // Alert Handling #import #import -#import #import #import -#import -#import -#import -#import #import // Presentation Handling diff --git a/MVMCore/MVMCore/MainProtocols/DelegateObject.swift b/MVMCore/MVMCore/MainProtocols/DelegateObject.swift index bd7b4c6..88d26b1 100644 --- a/MVMCore/MVMCore/MainProtocols/DelegateObject.swift +++ b/MVMCore/MVMCore/MainProtocols/DelegateObject.swift @@ -13,7 +13,6 @@ import UIKit public weak var actionDelegate: (MVMCoreActionDelegateProtocol & NSObjectProtocol)? public weak var loadDelegate: (MVMCoreLoadDelegateProtocol & NSObjectProtocol)? public weak var alertDelegate: (MVMCoreAlertDelegateProtocol & NSObjectProtocol)? - public weak var topAlertDelegate: (MVMCoreTopAlertDelegateProtocol & NSObjectProtocol)? public weak var presentationDelegate: (MVMCorePresentationDelegateProtocol & NSObjectProtocol)? required override public init() { @@ -24,7 +23,6 @@ import UIKit actionDelegate = delegate as? (MVMCoreActionDelegateProtocol & NSObjectProtocol) loadDelegate = delegate as? (MVMCoreLoadDelegateProtocol & NSObjectProtocol) alertDelegate = delegate as? (MVMCoreAlertDelegateProtocol & NSObjectProtocol) - topAlertDelegate = delegate as? (MVMCoreTopAlertDelegateProtocol & NSObjectProtocol) presentationDelegate = delegate as? (MVMCorePresentationDelegateProtocol & NSObjectProtocol) } diff --git a/MVMCore/MVMCore/Singletons/MVMCoreObject.h b/MVMCore/MVMCore/Singletons/MVMCoreObject.h index f7ad479..03a8411 100644 --- a/MVMCore/MVMCore/Singletons/MVMCoreObject.h +++ b/MVMCore/MVMCore/Singletons/MVMCoreObject.h @@ -15,7 +15,6 @@ #import #import #import -#import #import #import @@ -32,7 +31,6 @@ @property (nullable, strong, nonatomic) id globalLoadDelegate; @property (nullable, strong, nonatomic) id loadingProtocol; @property (nullable, strong, nonatomic) NSObject *loggingDelegate; -@property (nullable, strong, nonatomic) id globalTopAlertDelegate; // A reference to the calling application delegate that should be set. For a normal app, could be the UIApplicationDelegate. For watch, could be WKExtensionDelegate. For iMessage, could be MSMessagesAppViewController. etc, etc. Useful for the framework to call delegate specific functions. @property (nullable, weak, nonatomic) id applicationDelegate;