Session timeout improvement. Navigation error logging
This commit is contained in:
parent
9bfd5e9138
commit
f26dd47d23
@ -31,4 +31,8 @@
|
||||
[self didChangeValueForKey:@"isVisible"];
|
||||
}
|
||||
|
||||
- (NSString *)description {
|
||||
return [NSString stringWithFormat:@"%@|title=%@|message=%@", [super description],self.title,self.message];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -37,5 +37,6 @@ typedef NS_ENUM(NSInteger, ErrorCode) {
|
||||
ErrorCodeNoModule,
|
||||
ErrorCodeInvalidSettingType,
|
||||
ErrorCodeServerFailSendFaceIDHash,
|
||||
ErrorCodeSSL
|
||||
ErrorCodeSSL,
|
||||
ErrorCodeNoViewControllerToPresentOn
|
||||
};
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user