@ -550,7 +550,7 @@ static NSTimeInterval launchStartedAt;
if ( !AppReadiness . isAppReady ) {
OWSLogWarn ( @ "Ignoring openURL : app not ready . ") ;
/ / We don ' t need to use [ AppReadiness runNowOrWhenApp Is Ready: ] ;
/ / We don ' t need to use [ AppReadiness runNowOrWhenApp DidBecome Ready: ] ;
/ / the only URLs we handle in Signal iOS at the moment are used
/ / for resuming the verification step of the registration flow .
return NO ;
@ -596,7 +596,7 @@ static NSTimeInterval launchStartedAt;
[ self ensureRootViewController ] ;
[ AppReadiness runNowOrWhenApp Is Ready: ^{
[ AppReadiness runNowOrWhenApp DidBecome Ready: ^{
[ self handleActivation ] ;
} ] ;
@ -616,7 +616,7 @@ static NSTimeInterval launchStartedAt;
- ( void ) enableBackgroundRefreshIfNecessary
{
[ AppReadiness runNowOrWhenApp Is Ready: ^{
[ AppReadiness runNowOrWhenApp DidBecome Ready: ^{
if ( OWS2FAManager . sharedManager . is2FAEnabled && [ self . tsAccountManager isRegistered ] ) {
/ / Ping server once a day to keep - alive 2 FA clients .
const NSTimeInterval kBackgroundRefreshInterval = 24 * 60 * 60 ;
@ -732,7 +732,7 @@ static NSTimeInterval launchStartedAt;
OWSAssertIsOnMainThread ( ) ;
[ SignalApp clearAllNotifications ] ;
[ AppReadiness runNowOrWhenApp Is Ready: ^{
[ AppReadiness runNowOrWhenApp DidBecome Ready: ^{
[ OWSMessageUtils . sharedManager updateApplicationBadgeCount ] ;
} ] ;
}
@ -747,7 +747,7 @@ static NSTimeInterval launchStartedAt;
return ;
}
[ AppReadiness runNowOrWhenApp Is Ready: ^{
[ AppReadiness runNowOrWhenApp DidBecome Ready: ^{
if ( ![ self . tsAccountManager isRegistered ] ) {
UIAlertController * controller =
[ UIAlertController alertControllerWithTitle : NSLocalizedString ( @ "REGISTER_CONTACTS_WELCOME ", nil )
@ -818,7 +818,7 @@ static NSTimeInterval launchStartedAt;
return NO ;
}
[ AppReadiness runNowOrWhenApp Is Ready: ^{
[ AppReadiness runNowOrWhenApp DidBecome Ready: ^{
NSString * _Nullable phoneNumber = handle ;
if ( [ handle hasPrefix : CallKitCallManager . kAnonymousCallHandlePrefix ] ) {
phoneNumber = [ self . primaryStorage phoneNumberForCallKitId : handle ] ;
@ -875,7 +875,7 @@ static NSTimeInterval launchStartedAt;
return NO ;
}
[ AppReadiness runNowOrWhenApp Is Ready: ^{
[ AppReadiness runNowOrWhenApp DidBecome Ready: ^{
NSString * _Nullable phoneNumber = handle ;
if ( [ handle hasPrefix : CallKitCallManager . kAnonymousCallHandlePrefix ] ) {
phoneNumber = [ self . primaryStorage phoneNumberForCallKitId : handle ] ;
@ -980,7 +980,7 @@ static NSTimeInterval launchStartedAt;
}
OWSLogInfo ( @ "%@", notification);
[ AppReadiness runNowOrWhenApp Is Ready: ^{
[ AppReadiness runNowOrWhenApp DidBecome Ready: ^{
[ [ PushManager sharedManager ] application : application didReceiveLocalNotification : notification ] ;
} ] ;
}
@ -1003,7 +1003,7 @@ static NSTimeInterval launchStartedAt;
/ / later , after this method returns .
/ /
/ / https : / / developer . apple . com / documentation / uikit / uiapplicationdelegate / 1623068 - application ?language = objc
[ AppReadiness runNowOrWhenApp Is Ready: ^{
[ AppReadiness runNowOrWhenApp DidBecome Ready: ^{
[ [ PushManager sharedManager ] application : application
handleActionWithIdentifier : identifier
forLocalNotification : notification
@ -1032,7 +1032,7 @@ static NSTimeInterval launchStartedAt;
/ / later , after this method returns .
/ /
/ / https : / / developer . apple . com / documentation / uikit / uiapplicationdelegate / 1623068 - application ?language = objc
[ AppReadiness runNowOrWhenApp Is Ready: ^{
[ AppReadiness runNowOrWhenApp DidBecome Ready: ^{
[ [ PushManager sharedManager ] application : application
handleActionWithIdentifier : identifier
forLocalNotification : notification
@ -1045,7 +1045,7 @@ static NSTimeInterval launchStartedAt;
performFetchWithCompletionHandler : ( void ( ^) ( UIBackgroundFetchResult result ) ) completionHandler
{
OWSLogInfo ( @ "performing background fetch ") ;
[ AppReadiness runNowOrWhenApp Is Ready: ^{
[ AppReadiness runNowOrWhenApp DidBecome Ready: ^{
__block AnyPromise * job = [ AppEnvironment . shared . messageFetcherJob run ] . then ( ^{
/ / HACK : Call completion handler after n seconds .
/ /
@ -1130,17 +1130,9 @@ static NSTimeInterval launchStartedAt;
[ AppVersion . sharedInstance mainAppLaunchDidComplete ] ;
[ Environment . shared . contactsManager setup ] ;
[ Environment . shared . contactsManager startObserving ] ;
/ / If there were any messages in our local queue which we hadn ' t yet processed .
[ SSKEnvironment . shared . messageReceiver handleAnyUnprocessedEnvelopesAsync ] ;
[ SSKEnvironment . shared . batchMessageProcessor handleAnyUnprocessedEnvelopesAsync ] ;
[ Environment . shared . audioSession setup ] ;
[ SSKEnvironment . shared . reachabilityManager setup ] ;
[ SSKEnvironment . shared . messageSenderJobQueue setup ] ;
[ AppEnvironment . shared . sessionResetJobQueue setup ] ;
if ( !Environment . shared . preferences . hasGeneratedThumbnails ) {
[ self . primaryStorage . newDatabaseConnection