diff --git a/MVMCore/MVMCore.xcodeproj/project.pbxproj b/MVMCore/MVMCore.xcodeproj/project.pbxproj index 71297bc..1036709 100644 --- a/MVMCore/MVMCore.xcodeproj/project.pbxproj +++ b/MVMCore/MVMCore.xcodeproj/project.pbxproj @@ -118,7 +118,6 @@ AFED77A71FCCA29400BAE689 /* MVMCoreViewControllerProgrammaticMappingObject.m in Sources */ = {isa = PBXBuildFile; fileRef = AFED779F1FCCA29400BAE689 /* MVMCoreViewControllerProgrammaticMappingObject.m */; }; AFED77A81FCCA29400BAE689 /* MVMCoreViewControllerStoryBoardMappingObject.h in Headers */ = {isa = PBXBuildFile; fileRef = AFED77A01FCCA29400BAE689 /* MVMCoreViewControllerStoryBoardMappingObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; AFEEE8191FCDEB8D00B5EDD0 /* MVMCoreLoggingDelegateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFEEE8181FCDDE6B00B5EDD0 /* MVMCoreLoggingDelegateProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; - AFEEE81B1FCDEBFA00B5EDD0 /* MobileFirstProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFEEE81A1FCDEBFA00B5EDD0 /* MobileFirstProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; AFEEE81E1FCDF3CA00B5EDD0 /* MVMCoreLoggingHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = AFEEE81C1FCDF3CA00B5EDD0 /* MVMCoreLoggingHandler.h */; settings = {ATTRIBUTES = (Public, ); }; }; AFEEE81F1FCDF3CA00B5EDD0 /* MVMCoreLoggingHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = AFEEE81D1FCDF3CA00B5EDD0 /* MVMCoreLoggingHandler.m */; }; AFFCFA651FCCC0D700FD0730 /* MVMCoreLoadingOverlayDelegateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFFCFA611FCCC0D600FD0730 /* MVMCoreLoadingOverlayDelegateProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -245,7 +244,6 @@ AFED779F1FCCA29400BAE689 /* MVMCoreViewControllerProgrammaticMappingObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreViewControllerProgrammaticMappingObject.m; sourceTree = ""; }; AFED77A01FCCA29400BAE689 /* MVMCoreViewControllerStoryBoardMappingObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreViewControllerStoryBoardMappingObject.h; sourceTree = ""; }; AFEEE8181FCDDE6B00B5EDD0 /* MVMCoreLoggingDelegateProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreLoggingDelegateProtocol.h; sourceTree = ""; }; - AFEEE81A1FCDEBFA00B5EDD0 /* MobileFirstProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MobileFirstProtocol.h; sourceTree = ""; }; AFEEE81C1FCDF3CA00B5EDD0 /* MVMCoreLoggingHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreLoggingHandler.h; sourceTree = ""; }; AFEEE81D1FCDF3CA00B5EDD0 /* MVMCoreLoggingHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreLoggingHandler.m; sourceTree = ""; }; AFFCFA611FCCC0D600FD0730 /* MVMCoreLoadingOverlayDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreLoadingOverlayDelegateProtocol.h; sourceTree = ""; }; @@ -379,7 +377,6 @@ AF43A7191FC5BE9E008E9347 /* MainProtocols */ = { isa = PBXGroup; children = ( - AFEEE81A1FCDEBFA00B5EDD0 /* MobileFirstProtocol.h */, AF43A71A1FC5BEBB008E9347 /* MVMCoreViewControllerProtocol.h */, AF43A71F1FC5D2BA008E9347 /* MVMCoreViewManagerProtocol.h */, AF43A7401FC5FA6F008E9347 /* MVMCoreViewProtocol.h */, @@ -625,7 +622,6 @@ AF43A5771FBA5B7C008E9347 /* MVMCoreJSONConstants.h in Headers */, 88D1FBE11FCCCBA100338A3A /* MVMCoreMainSplitViewProtocol.h in Headers */, AFBB96631FBA3A570008D868 /* MVMCoreLoadRequestOperation.h in Headers */, - AFEEE81B1FCDEBFA00B5EDD0 /* MobileFirstProtocol.h in Headers */, AFBB969D1FBA3A9A0008D868 /* MVMCoreAlertObject.h in Headers */, 8876D5CE1FB50A9E00EB2E3D /* MVMCore.h in Headers */, AFBB965E1FBA3A570008D868 /* MFFreebeeOperation.h in Headers */, diff --git a/MVMCore/MVMCore.xcodeproj/xcuserdata/yangti5.xcuserdatad/xcschemes/xcschememanagement.plist b/MVMCore/MVMCore.xcodeproj/xcuserdata/yangti5.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 79ba96a..0000000 --- a/MVMCore/MVMCore.xcodeproj/xcuserdata/yangti5.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,19 +0,0 @@ - - - - - SchemeUserState - - MVMCore.xcscheme - - orderHint - 17 - - MVMCore.xcscheme_^#shared#^_ - - orderHint - 6 - - - - diff --git a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m index 947ad6b..4eaa67e 100644 --- a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m +++ b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.m @@ -162,8 +162,8 @@ NSString * const KeyActionTypeOpen = @"openPage"; // Restart the application with the page type. NSString *pageType = [actionInformation string:KeyPageType]; - [[MVMCoreObject sharedInstance].mobileFirstDelegate addModifiedSendParametersForLaunch:[actionInformation dict:KeyExtraParameters]]; - [[MVMCoreObject sharedInstance].mobileFirstDelegate restartWithPageType:pageType clearSessionVariables:YES]; + NSDictionary *parameters = [actionInformation dict:KeyExtraParameters]; + [[MVMCoreSessionObject sharedGlobal] restartSessionWithPageType:pageType parameters:parameters clearAllVariables:YES]; } } }]; diff --git a/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.h b/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.h index 244cd37..3d281ae 100644 --- a/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.h +++ b/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.h @@ -16,8 +16,6 @@ extern NSString * const KeyCloseButton; extern NSString * const KeyMessageStyle; extern NSString * const KeyErrorHeading; -extern NSString * const KeyAppState; - extern NSString * const KeyPage; extern NSString * const KeyPageType; extern NSString * const KeyModuleMap; @@ -25,8 +23,6 @@ extern NSString * const KeyModuleList; extern NSString * const KeyPageMap; extern NSString * const KeySystemParameters; extern NSString * const KeyButtonMap; -extern NSString * const KeyActionMap; -extern NSString * const KeyDisableButton; extern NSString * const KeyOpenSupport; extern NSString * const KeyLinks; @@ -53,17 +49,6 @@ extern NSString * const KeyContextRoot; extern NSString * const KeyType; extern NSString * const KeyMVMRC; -extern NSString * const KeyRememberMe; -extern NSString * const KeySSOSection; -extern NSString * const KeySSOHashSection; -extern NSString * const KeyEnableAnalytics; -extern NSString * const KeyUserAuthenticateTokenHash; - -#pragma mark- SSN Json Keys - -extern NSString * const ParameterOSVersion; -extern NSString * const CLIENT_SSL_STATUS_KEY; - #pragma mark - JSON Values // Server driven response type diff --git a/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.m b/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.m index 1479f3f..bd1c735 100644 --- a/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.m +++ b/MVMCore/MVMCore/Constants/MVMCoreJSONConstants.m @@ -16,8 +16,6 @@ NSString * const KeyCloseButton = @"closeButton"; NSString * const KeyMessageStyle = @"messageStyle"; NSString * const KeyErrorHeading = @"errorHdg"; -NSString * const KeyAppState = @"appState"; - NSString * const KeyPage = @"Page"; NSString * const KeyPageType = @"pageType"; NSString * const KeyModuleMap = @"ModuleMap"; @@ -25,8 +23,6 @@ NSString * const KeyModuleList = @"modules"; NSString * const KeyPageMap = @"PageMap"; NSString * const KeySystemParameters = @"SystemParams"; NSString * const KeyButtonMap = @"ButtonMap"; -NSString * const KeyActionMap = @"ActionMap"; -NSString * const KeyDisableButton = @"disableAction"; NSString * const KeyOpenSupport = @"openSupport"; NSString * const KeyLinks = @"Links"; @@ -53,17 +49,6 @@ NSString * const KeyContextRoot = @"appContext"; NSString * const KeyType = @"type"; NSString * const KeyMVMRC = @"LaunchMVMRC"; -NSString * const KeyRememberMe = @"Store_Info"; -NSString * const KeySSOSection = @"SSO"; -NSString * const KeySSOHashSection = @"deviceMdnHashMap"; -NSString * const KeyEnableAnalytics = @"enableAnalytics"; -NSString * const KeyUserAuthenticateTokenHash = @"UserAuthenticateTokenHash"; - -NSString * const ParameterOSVersion = @"osVersion"; - -#pragma mark- SSL Json Keys -NSString * const CLIENT_SSL_STATUS_KEY = @"clientSSLStatus"; - #pragma mark - JSON Values // Server driven response type diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m index aae485c..18f2139 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m @@ -21,6 +21,7 @@ #import "MVMCoreErrorConstants.h" #import "MVMCoreHardcodedStringsConstants.h" #import "MVMCoreObject.h" +#import "MVMCoreConstants.h" @interface MVMCoreLoadHandler () @@ -175,12 +176,11 @@ [parameters setObject:requestParameters.parameters forKey:@"RequestParams"]; } - if ([[MVMCoreObject sharedInstance].mobileFirstDelegate shouldLogRequestsResponse]) { - NSError *error = nil; - NSData *data = [NSJSONSerialization dataWithJSONObject:parameters options:NSJSONWritingPrettyPrinted error:&error]; - NSString *jsonString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - MVMCoreLog(@"Request Parameters for URL %@:\n%@",[request.URL absoluteString], jsonString); - } + // Logs the request parameters. + NSError *error = nil; + NSData *data = [NSJSONSerialization dataWithJSONObject:parameters options:NSJSONWritingPrettyPrinted error:&error]; + NSString *jsonString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + MVMCoreLog(@"Request Parameters for URL %@:\n%@",[request.URL absoluteString], jsonString); //adding Free Bee header if ([[MFFreebeeHandler sharedHandler] isFreeBeeEnabled] @@ -201,8 +201,8 @@ } } - NSError *error; - NSData *body = [self createBodyForRequestUsingParameters:parameters requestParameters:requestParameters error:&error]; + NSError *bodyError; + NSData *body = [self createBodyForRequestUsingParameters:parameters requestParameters:requestParameters error:&bodyError]; if (body) { [request setHTTPBody:body]; } else { @@ -341,7 +341,7 @@ // Error serializing json. errorObject = [[MVMCoreErrorObject alloc] initWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorCritical] messageToLog:[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] code:ErrorCodeParsingJSON domain:ErrorDomainNative location:locationForError]; - } else if ([[MVMCoreObject sharedInstance].mobileFirstDelegate shouldLogRequestsResponse]) { + } else { // Uncomment to get the raw UTF-8 string response from server before it is parsed. Useful for identifying issues such as duplicate definitions which are removed after parsing. (Also, be careful of parsing tools such as jsoneditoronline.org which will autoresolve some of these issues as well.) // MVMCoreLog(@"Raw Response:\n%@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]); diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 0b530b5..205b59b 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -28,6 +28,7 @@ #import "MVMCoreActionUtility.h" #import #import "MVMCoreObject.h" +#import "MVMCoreConstants.h" @interface MVMCoreLoadRequestOperation () @@ -133,14 +134,12 @@ return; } - // Log if needed. - if ([[MVMCoreObject sharedInstance].mobileFirstDelegate shouldLogRequestsResponse]) { - if (pageFromCache) { - MVMCoreLog(@"loaded from cache page %@",[MVMCoreActionUtility formatDictionaryAsJSONString:pageFromCache]); - } - if (modulesFromCache) { - MVMCoreLog(@"loaded from cache modules %@",[MVMCoreActionUtility formatDictionaryAsJSONString:modulesFromCache]); - } + // Log if loaded from cache. + if (pageFromCache) { + MVMCoreLog(@"loaded from cache page %@",[MVMCoreActionUtility formatDictionaryAsJSONString:pageFromCache]); + } + if (modulesFromCache) { + MVMCoreLog(@"loaded from cache modules %@",[MVMCoreActionUtility formatDictionaryAsJSONString:modulesFromCache]); } // Create a load object from any data we fetched. diff --git a/MVMCore/MVMCore/MVMCore.h b/MVMCore/MVMCore/MVMCore.h index dd07706..9c24e1c 100644 --- a/MVMCore/MVMCore/MVMCore.h +++ b/MVMCore/MVMCore/MVMCore.h @@ -90,7 +90,6 @@ FOUNDATION_EXPORT const unsigned char MVMCoreVersionString[]; #import // Other Handlers and Protocols -#import #import // Singletons diff --git a/MVMCore/MVMCore/MainProtocols/MobileFirstProtocol.h b/MVMCore/MVMCore/MainProtocols/MobileFirstProtocol.h deleted file mode 100644 index 61f54b2..0000000 --- a/MVMCore/MVMCore/MainProtocols/MobileFirstProtocol.h +++ /dev/null @@ -1,65 +0,0 @@ -// -// MobileFirstProtocol.h -// mobilefirst -// -// Created by Scott Pfeil on 4/26/16. -// Copyright © 2016 Verizon Wireless. All rights reserved. -// - -#import -#import -#import -#import -@class MVMCoreSessionObject; - -@protocol MobileFirstProtocol - -// For if the app is testing. -- (BOOL)isTesting; - -// For if mobile first should use sso. -- (BOOL)shouldUseSSO; - -// For if mobile first should log requests and responses to the console. -- (BOOL)shouldLogRequestsResponse; - -//// Return the session singleton to use. (temp not in use) -//- (nonnull MVMCoreSessionObject *)getSessionSingleton; - -// Adds modified send parameters that will be passed to the server during initial mvm load -- (void)addModifiedSendParametersForLaunch:(nullable NSDictionary *)modifiedSendParameters; - -/* Restarts the application. - * @param pageType A page type to start with loading. - * @param clearSessionVariables A Boolean to determine if we should clear the session variables. - */ -- (void)restartWithPageType:(nullable NSString *)pageType clearSessionVariables:(BOOL)clearSessionVariables; - -// Redirect, leaving mobile first. -- (void)redirectWithAppContext:(MVMAppContext)context pageType:(nullable NSString *)pageType extraParameters:(nullable NSDictionary *)extraParameters storeContextForNextRestart:(BOOL)storeContextForNextRestart; - -// Call when deep link finished. -- (void)deepLinkFinished; - -// Called when the app is launched. -- (void)launchedWithMDN:(nonnull NSString *)mdn context:(MVMAppContext)context dataMeterUsage:(nullable NSDictionary *)dataMeterUsage other:(nullable NSDictionary *)other; - -// Loads content transfer -- (void)loadContentTransfer; - -// loads activation -- (void)loadActivation; - -// loads mvd active -- (void)presentMvdActive:(nullable NSDictionary*)data; - -// Called when pop data is started. -- (void)clearspotStartedWithTimeRemaining:(nonnull NSString *)timeRemaining; - -// Called when legacy SMART should be enabled. -- (void)onSmartLegacyFallback; - -// Currently only used by ipad. It's a token used to identify the device. -- (nullable NSString *)getDeviceToken; - -@end diff --git a/MVMCore/MVMCore/Session/MVMCoreSessionObject.h b/MVMCore/MVMCore/Session/MVMCoreSessionObject.h index 133af32..04f64ad 100644 --- a/MVMCore/MVMCore/Session/MVMCoreSessionObject.h +++ b/MVMCore/MVMCore/Session/MVMCoreSessionObject.h @@ -29,8 +29,8 @@ // Gets inital parameters for request parameters. - (nullable NSDictionary *)getInitialParameters; -// Restarts the application session state. -- (void)restartSession:(BOOL)clearAllVariables; +// 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; // Redirect, leaving the current app experience. - (void)redirectWithInfo:(nullable NSDictionary *)dictionary; diff --git a/MVMCore/MVMCore/Session/MVMCoreSessionObject.m b/MVMCore/MVMCore/Session/MVMCoreSessionObject.m index 4daae8a..343afbb 100644 --- a/MVMCore/MVMCore/Session/MVMCoreSessionObject.m +++ b/MVMCore/MVMCore/Session/MVMCoreSessionObject.m @@ -19,10 +19,10 @@ return nil; } -- (void)restartSession:(BOOL)clearAllVariables { +- (void)restartSessionWithPageType:(nullable NSString *)pageType parameters:(nullable NSDictionary *)parameters clearAllVariables:(BOOL)clearAllVariables { // Clears the singletons of any session related data. if (clearAllVariables) { - [[MVMCoreSessionObject sharedGlobal] clearSessionObject]; + [self clearSessionObject]; } } diff --git a/MVMCore/MVMCore/Singletons/MVMCoreObject.h b/MVMCore/MVMCore/Singletons/MVMCoreObject.h index 2a7eac5..21aed2d 100644 --- a/MVMCore/MVMCore/Singletons/MVMCoreObject.h +++ b/MVMCore/MVMCore/Singletons/MVMCoreObject.h @@ -12,7 +12,6 @@ #import #import #import -#import #import #import #import @@ -33,7 +32,6 @@ @property (nullable, weak, nonatomic) MVMCoreTopAlertView *topAlertView; // The delegates -@property (nullable, weak, nonatomic) id mobileFirstDelegate; @property (nullable, weak, nonatomic) NSObject *splitViewDelegate; @property (nullable, weak, nonatomic) id globalLoadDelegate; @property (nullable, weak, nonatomic) id loadingProtocol;