diff --git a/mParticle-Apple-SDK/MPBackendController.m b/mParticle-Apple-SDK/MPBackendController.m index 03fefa58..9bcdeb98 100644 --- a/mParticle-Apple-SDK/MPBackendController.m +++ b/mParticle-Apple-SDK/MPBackendController.m @@ -2092,7 +2092,7 @@ - (void)endSessionIfTimedOut { [MParticle executeOnMessage:^{ [[MParticle sharedInstance].persistenceController updateSession:self.session]; [self processOpenSessionsEndingCurrent:YES completionHandler:^(void) { - [self beginSession]; + MPILogVerbose(@"Session ended in the background. New session will begin if an mParticle event is logged or app enters foreground."); }]; }]; } @@ -2228,6 +2228,8 @@ - (void)handleApplicationWillEnterForeground:(NSNotification *)notification { [self updateSessionBackgroundTime]; } + [self beginSession]; + #if TARGET_OS_IOS == 1 #ifndef MPARTICLE_LOCATION_DISABLE [MParticle executeOnMain:^{