Merge branch 'feature/push_interstitial_change' into 'develop'

Post call actions added

See merge request BPHV_MIPS/mvm_core!18
This commit is contained in:
Suresh, Kamlesh 2019-06-13 08:44:45 -04:00
commit 12edb0fb91

View File

@ -845,9 +845,31 @@
} else {
[MVMCoreLoggingHandler logWithDelegateLoadFinished:loadObject loadedViewController:loadedViewController error:errorObject];
}
//make post load calls function
[MVMCoreLoadRequestOperation loadPostCallActions:loadObject];
[loadObject.operation markAsFinished];
}
+ (void)loadPostCallActions:(nonnull MVMCoreLoadObject *)loadObject {
NSDictionary *postCallsDict = [loadObject.pageJSON dict:@"postLoadActions"];
if (postCallsDict) {
NSArray *actionList = [postCallsDict array:@"actionList"];
//TODO needs to create operation queue based on concurrent flag
BOOL isConcurrent = [postCallsDict boolForKey:@"concurrent"];
//Needs further enhancements based on the flags.
BOOL shouldTriggerFromCache = [postCallsDict boolForKey:@"shouldTriggerFromCache"];
//Check if page is not from cache
if (!loadObject.pageDataFromCache || shouldTriggerFromCache) {
[actionList enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
[[MVMCoreActionHandler sharedActionHandler] handleActionWithDictionary:obj additionalData:nil delegateObject:nil];
}];
}
}
}
#pragma mark - Presentation Delegate
- (void)navigationController:(UINavigationController *)navigationController willDisplayViewController:(UIViewController *)viewController {