Merge pull request #8 in BPHVB/mvm_core from release/6_0 to develop

* commit '8165ce821c70add8a592c9d6a402a688b83220f7':
  Session timeout improvement. Navigation error logging
This commit is contained in:
Pfeil, Scott Robert 2018-02-26 17:18:02 -05:00
commit 88a98facf5
4 changed files with 18 additions and 7 deletions

View File

@ -31,4 +31,8 @@
[self didChangeValueForKey:@"isVisible"];
}
- (NSString *)description {
return [NSString stringWithFormat:@"%@|title=%@|message=%@", [super description],self.title,self.message];
}
@end

View File

@ -37,5 +37,6 @@ typedef NS_ENUM(NSInteger, ErrorCode) {
ErrorCodeNoModule,
ErrorCodeInvalidSettingType,
ErrorCodeServerFailSendFaceIDHash,
ErrorCodeSSL
ErrorCodeSSL,
ErrorCodeNoViewControllerToPresentOn
};

View File

@ -14,6 +14,8 @@
#import "MVMCoreLoadObject.h"
#import "MVMCoreObject.h"
#import "MVMCoreRequestParameters.h"
#import "MVMCoreErrorConstants.h"
#import "MVMCoreLoggingHandler.h"
@interface MVMCoreNavigationHandler ()
@ -265,8 +267,9 @@
- (void)presentViewController:(nonnull UIViewController *)viewController animated:(BOOL)animated delegate:(nullable NSObject<MVMCorePresentationDelegateProtocol>*)delegate completionHandler:(nullable void (^)(void))completionBlock {
if (!self.viewControllerToPresentOn) {
NSException *exception = [NSException exceptionWithName:@"NoViewControllerToPresentOnException" reason:@"The viewControllerToPresent on property is nil and an attempt was made to present." userInfo:nil];
@throw exception;
// Log if we are attempting to add an alert to nothing.
MVMCoreErrorObject *error = [[MVMCoreErrorObject alloc] initWithTitle:nil message:@"The viewControllerToPresent on property is nil and an attempt was made to present." code:ErrorCodeNoViewControllerToPresentOn domain:ErrorDomainNative location:[NSString stringWithFormat:@"ViewController:%@|Delegate:%@",viewController.description,delegate]];
[MVMCoreLoggingHandler addErrorToLog:error];
} else {
MVMCorePresentViewControllerOperation *operation = [[MVMCorePresentViewControllerOperation alloc] initWithPresentingViewController:self.viewControllerToPresentOn presentedViewController:viewController animated:animated];
operation.delegate = delegate;

View File

@ -107,10 +107,13 @@
self.timeTimerStarted = [NSDate timeIntervalSinceReferenceDate];
}
if (!fequal(0, self.secondsUntilWarning)) {
self.sessionTimer = [NSTimer scheduledTimerWithTimeInterval:self.secondsUntilWarning target:self selector:@selector(sessionTimeoutWarning) userInfo:nil repeats:NO];
} else if (!fequal(0, self.secondsUntilTimeout)) {
self.sessionTimer = [NSTimer scheduledTimerWithTimeInterval:self.secondsUntilTimeout target:self selector:@selector(sessionTimeout:) userInfo:nil repeats:NO];
// Only start physical timer if active, otherwise will begin once entering foreground.
if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
if (!fequal(0, self.secondsUntilWarning)) {
self.sessionTimer = [NSTimer scheduledTimerWithTimeInterval:self.secondsUntilWarning target:self selector:@selector(sessionTimeoutWarning) userInfo:nil repeats:NO];
} else if (!fequal(0, self.secondsUntilTimeout)) {
self.sessionTimer = [NSTimer scheduledTimerWithTimeInterval:self.secondsUntilTimeout target:self selector:@selector(sessionTimeout:) userInfo:nil repeats:NO];
}
}
}
});