Shift app background check to resumeSessionTimer to make isAppInSession and revalidateSessionTimestamp background safe.
This commit is contained in:
parent
c7bfda216a
commit
80512a0b8a
@ -124,11 +124,7 @@
|
|||||||
if (!fequal(0, self.secondsUntilTimeout)) {
|
if (!fequal(0, self.secondsUntilTimeout)) {
|
||||||
self.sessionBeingTimed = YES;
|
self.sessionBeingTimed = YES;
|
||||||
[self markStartTime];
|
[self markStartTime];
|
||||||
|
[self resumeSessionTimer];
|
||||||
// Only start physical timer if active, otherwise will begin once entering foreground. FaceId prompt is considered UIApplicationStateInactive.
|
|
||||||
if ([UIApplication sharedApplication].applicationState != UIApplicationStateBackground) {
|
|
||||||
[self resumeSessionTimer];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -137,6 +133,11 @@
|
|||||||
/// Resume the session timers if they are stopped.
|
/// Resume the session timers if they are stopped.
|
||||||
- (void)resumeSessionTimer {
|
- (void)resumeSessionTimer {
|
||||||
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
||||||
|
// Only start physical timer if active, otherwise will begin once entering foreground. FaceId prompt is considered UIApplicationStateInactive.
|
||||||
|
if ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!fequal(0, self.secondsUntilWarning) && ![self.sessionWarningTimer isValid]) {
|
if (!fequal(0, self.secondsUntilWarning) && ![self.sessionWarningTimer isValid]) {
|
||||||
self.sessionWarningTimer = [NSTimer scheduledTimerWithTimeInterval:[self remainingTimeUntilWarning] target:self selector:@selector(sessionTimeoutWarning) userInfo:nil repeats:NO];
|
self.sessionWarningTimer = [NSTimer scheduledTimerWithTimeInterval:[self remainingTimeUntilWarning] target:self selector:@selector(sessionTimeoutWarning) userInfo:nil repeats:NO];
|
||||||
MVMCoreLog(@"Session warning will fire at: %@", self.sessionWarningTimer.fireDate);
|
MVMCoreLog(@"Session warning will fire at: %@", self.sessionWarningTimer.fireDate);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user