Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Prevent Repeated Sessions on active Background #290

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion mParticle-Apple-SDK/MPBackendController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}];
}];
}
Expand Down Expand Up @@ -2228,6 +2228,8 @@ - (void)handleApplicationWillEnterForeground:(NSNotification *)notification {
[self updateSessionBackgroundTime];
}

[self beginSession];

#if TARGET_OS_IOS == 1
#ifndef MPARTICLE_LOCATION_DISABLE
[MParticle executeOnMain:^{
Expand Down