update core

This commit is contained in:
Yang, Tianhang(Chris) 2017-12-20 10:22:58 -05:00
parent 80ab33db45
commit 2bd63258ff
12 changed files with 22 additions and 144 deletions

View File

@ -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 = "<group>"; };
AFED77A01FCCA29400BAE689 /* MVMCoreViewControllerStoryBoardMappingObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreViewControllerStoryBoardMappingObject.h; sourceTree = "<group>"; };
AFEEE8181FCDDE6B00B5EDD0 /* MVMCoreLoggingDelegateProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreLoggingDelegateProtocol.h; sourceTree = "<group>"; };
AFEEE81A1FCDEBFA00B5EDD0 /* MobileFirstProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MobileFirstProtocol.h; sourceTree = "<group>"; };
AFEEE81C1FCDF3CA00B5EDD0 /* MVMCoreLoggingHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreLoggingHandler.h; sourceTree = "<group>"; };
AFEEE81D1FCDF3CA00B5EDD0 /* MVMCoreLoggingHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreLoggingHandler.m; sourceTree = "<group>"; };
AFFCFA611FCCC0D600FD0730 /* MVMCoreLoadingOverlayDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreLoadingOverlayDelegateProtocol.h; sourceTree = "<group>"; };
@ -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 */,

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>MVMCore.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>17</integer>
</dict>
<key>MVMCore.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>6</integer>
</dict>
</dict>
</dict>
</plist>

View File

@ -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];
}
}
}];

View File

@ -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

View File

@ -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

View File

@ -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]);

View File

@ -28,6 +28,7 @@
#import "MVMCoreActionUtility.h"
#import <MVMCore/MVMCoreActionHandler.h>
#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.

View File

@ -90,7 +90,6 @@ FOUNDATION_EXPORT const unsigned char MVMCoreVersionString[];
#import <MVMCore/MVMCoreLoggingDelegateProtocol.h>
// Other Handlers and Protocols
#import <MVMCore/MobileFirstProtocol.h>
#import <MVMCore/MVMCoreLoggingHandler.h>
// Singletons

View File

@ -1,65 +0,0 @@
//
// MobileFirstProtocol.h
// mobilefirst
//
// Created by Scott Pfeil on 4/26/16.
// Copyright © 2016 Verizon Wireless. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <MVMCore/MVMCoreConstants.h>
#import <MVMCore/MVMCoreErrorObject.h>
#import <MVMCore/MVMCoreRequestParameters.h>
@class MVMCoreSessionObject;
@protocol MobileFirstProtocol <NSObject>
// 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

View File

@ -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;

View File

@ -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];
}
}

View File

@ -12,7 +12,6 @@
#import <MVMCore/MVMCoreViewControllerMappingObject.h>
#import <MVMCore/MVMCoreActionHandler.h>
#import <MVMCore/MVMCoreSessionTimeHandler.h>
#import <MVMCore/MobileFirstProtocol.h>
#import <MVMCore/MVMCoreGlobalLoadProtocol.h>
#import <MVMCore/MVMCoreLoadingOverlayDelegateProtocol.h>
#import <MVMCore/MVMCoreMainSplitViewProtocol.h>
@ -33,7 +32,6 @@
@property (nullable, weak, nonatomic) MVMCoreTopAlertView *topAlertView;
// The delegates
@property (nullable, weak, nonatomic) id <MobileFirstProtocol> mobileFirstDelegate;
@property (nullable, weak, nonatomic) NSObject <MVMCoreMainSplitViewProtocol> *splitViewDelegate;
@property (nullable, weak, nonatomic) id <MVMCoreGlobalLoadProtocol> globalLoadDelegate;
@property (nullable, weak, nonatomic) id <MVMCoreLoadingOverlayDelegateProtocol> loadingProtocol;