mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fetch messages & ping friends when application becomes active
This commit is contained in:
parent
cc1f41c11b
commit
3c7b769d20
1 changed files with 8 additions and 1 deletions
|
@ -718,6 +718,12 @@ static NSTimeInterval launchStartedAt;
|
|||
[Environment.shared.contactsManager fetchSystemContactsOnceIfAlreadyAuthorized];
|
||||
[[AppEnvironment.shared.messageFetcherJob run] retainUntilComplete];
|
||||
|
||||
[LokiAPI getMessages:^(id response, NSError *error) {
|
||||
// TODO: Use the response
|
||||
}];
|
||||
|
||||
// TODO: Ping friends to let them know we're online
|
||||
|
||||
if (![UIApplication sharedApplication].isRegisteredForRemoteNotifications) {
|
||||
OWSLogInfo(@"Retrying to register for remote notifications since user hasn't registered yet.");
|
||||
// Push tokens don't normally change while the app is launched, so checking once during launch is
|
||||
|
@ -1152,6 +1158,7 @@ static NSTimeInterval launchStartedAt;
|
|||
[AppReadiness runNowOrWhenAppDidBecomeReady:^{
|
||||
[LokiAPI getMessages:^(id response, NSError *error) {
|
||||
if (response != nil) {
|
||||
// TODO: Use the response
|
||||
completionHandler(UIBackgroundFetchResultNewData);
|
||||
} else {
|
||||
completionHandler(UIBackgroundFetchResultFailed);
|
||||
|
|
Loading…
Reference in a new issue