Skip to content

Commit 02fd3f6

Browse files
committed
Use async api to preload user, installation, config on SDK initialization.
1 parent 235317a commit 02fd3f6

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Parse/Internal/ParseManager.m

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -427,15 +427,18 @@ - (BFTask *)preloadDiskObjectsToMemoryAsync {
427427
@weakify(self);
428428
return [BFTask taskFromExecutor:[BFExecutor executorWithDispatchQueue:_preloadQueue] withBlock:^id{
429429
@strongify(self);
430-
[PFUser currentUser];
431-
[PFConfig currentConfig];
430+
431+
NSArray *tasks = @[
432+
[PFUser getCurrentUserInBackground],
433+
[PFConfig getCurrentConfigInBackground],
432434
#if !TARGET_OS_WATCH && !TARGET_OS_TV
433-
[PFInstallation currentInstallation];
435+
[PFInstallation getCurrentInstallationInBackground],
434436
#endif
435-
436-
[self eventuallyQueue];
437-
438-
return nil;
437+
];
438+
return [[BFTask taskForCompletionOfAllTasks:tasks] continueWithBlock:^id(BFTask *_) {
439+
[self eventuallyQueue];
440+
return nil;
441+
}];
439442
}];
440443
}
441444

0 commit comments

Comments
 (0)