diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m index ad33438..db3673f 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m @@ -321,7 +321,7 @@ NSURLSessionTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - MVMCoreLog(@"Request Time %f",[NSDate timeIntervalSinceReferenceDate] - startTime); + MVMCoreLog(@"Request Time %f", [NSDate timeIntervalSinceReferenceDate] - startTime); NSDate *startTimeDate = [NSDate dateWithTimeIntervalSinceReferenceDate:startTime]; @@ -334,6 +334,8 @@ [trackInfo setObject:error.localizedDescription forKey:@"error"]; } + MVMCoreLog(@"Set-Cookie %@ Value: %@", requestParameters.pageType, [(NSHTTPURLResponse *)response allHeaderFields][@"Set-Cookie"]); + [MVMCoreLoggingHandler logWithDelegateWithObject:nil withName:@"httpRequestStatus" withExtraInfo:trackInfo]; id jsonObject = nil; diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index f04df88..3231d11 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -773,11 +773,10 @@ return; } + // If we have an alert to show and a loaded view controller, allow the loaded view controller to be the delegate. + DelegateObject *delegateObject = [loadedViewController respondsToSelector:@selector(delegateObject)] ? [loadedViewController delegateObject] : loadObject.operation.delegateObject; // Show any alerts that we have been saving. if (loadObject.operation.alertToShow) { - - // If we have an alert to show and a loaded view controller, allow the loaded view controller to be the delegate. - DelegateObject *delegateObject = [loadedViewController respondsToSelector:@selector(delegateObject)] ? [loadedViewController delegateObject] : loadObject.operation.delegateObject; [MVMCoreLoadRequestOperation createAndShowAlertForLoadObject:loadObject error:loadObject.operation.errorForAlertToShow delegateObject:delegateObject]; } @@ -790,6 +789,7 @@ //make post load calls function [MVMCoreLoadRequestOperation loadPostCallActions:loadObject]; + [MVMCoreLoadRequestOperation loadPostAction:loadObject delegateObject:delegateObject]; [loadObject.operation markAsFinished]; } @@ -812,6 +812,13 @@ } } ++ (void)loadPostAction:(nonnull MVMCoreLoadObject *)loadObject delegateObject:(nullable DelegateObject *)delegateObject { + NSDictionary *actionDict = [loadObject.responseJSON dict:@"PostAction"]; + if (actionDict) { + [[MVMCoreActionHandler sharedActionHandler] handleActionWithDictionary:actionDict additionalData:nil delegateObject:delegateObject]; + } +} + + (void)removeCaches:(nullable NSDictionary *)cacheDictionary { if (cacheDictionary) { diff --git a/MVMCore/MVMCore/MVMCore.h b/MVMCore/MVMCore/MVMCore.h index fa613c5..ca0b8a0 100644 --- a/MVMCore/MVMCore/MVMCore.h +++ b/MVMCore/MVMCore/MVMCore.h @@ -62,6 +62,7 @@ FOUNDATION_EXPORT const unsigned char MVMCoreVersionString[]; #import #import #import +#import // Action Handling #import