File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Leanplum-SDK/Classes/Internal Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 5050#import " LPFileTransferManager.h"
5151#import " LPRequestSender.h"
5252#import " LPAPIConfig.h"
53+ #import " LPOperationQueue.h"
5354
5455static NSString *leanplum_deviceId = nil ;
5556static NSString *registrationEmail = nil ;
@@ -1180,13 +1181,16 @@ + (void)pause
11801181
11811182 // Block that finish task.
11821183 void (^finishTaskHandler)(void ) = ^(){
1184+ // Make sure all database operations are done before ending the background task.
1185+ [[LPOperationQueue serialQueue ] waitUntilAllOperationsAreFinished ];
1186+
11831187 [application endBackgroundTask: backgroundTask];
11841188 backgroundTask = UIBackgroundTaskInvalid;
11851189 };
11861190
11871191 // Start background task to make sure it runs when the app is in background.
11881192 backgroundTask = [application beginBackgroundTaskWithExpirationHandler: finishTaskHandler];
1189-
1193+
11901194 // Send pause event.
11911195 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
11921196 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
You can’t perform that action at this time.
0 commit comments