Merge branch 'charlesmchen/fixWebsocket'

pull/1/head
Matthew Chen 8 years ago
commit 44c4d77440

@ -139,7 +139,7 @@ CHECKOUT OPTIONS:
:commit: 714f5ebe199ecc999b33c6f97a4bb57e2db90e75 :commit: 714f5ebe199ecc999b33c6f97a4bb57e2db90e75
:git: https://github.com/WhisperSystems/SignalProtocolKit.git :git: https://github.com/WhisperSystems/SignalProtocolKit.git
SignalServiceKit: SignalServiceKit:
:commit: 7b7b338075f3b4615755fcc1f1fb8a8c67b0bd0a :commit: 45391cadd32df2fd8e3ee6b63d294d11bff45077
:git: https://github.com/WhisperSystems/SignalServiceKit.git :git: https://github.com/WhisperSystems/SignalServiceKit.git
SocketRocket: SocketRocket:
:commit: 41b57bb2fc292a814f758441a05243eb38457027 :commit: 41b57bb2fc292a814f758441a05243eb38457027

@ -1,3 +1,7 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "AppDelegate.h" #import "AppDelegate.h"
#import "AppStoreRating.h" #import "AppStoreRating.h"
#import "CategorizingLogger.h" #import "CategorizingLogger.h"
@ -43,7 +47,13 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
#pragma mark Detect updates - perform migrations #pragma mark Detect updates - perform migrations
- (void)applicationDidEnterBackground:(UIApplication *)application {
DDLogWarn(@"%@ applicationDidEnterBackground.", self.tag);
}
- (void)applicationWillEnterForeground:(UIApplication *)application { - (void)applicationWillEnterForeground:(UIApplication *)application {
DDLogWarn(@"%@ applicationWillEnterForeground.", self.tag);
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0]; [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
} }
@ -227,6 +237,8 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
} }
- (void)applicationDidBecomeActive:(UIApplication *)application { - (void)applicationDidBecomeActive:(UIApplication *)application {
DDLogWarn(@"%@ applicationDidBecomeActive.", self.tag);
if (getenv("runningTests_dontStartApp")) { if (getenv("runningTests_dontStartApp")) {
return; return;
} }
@ -248,6 +260,8 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
} }
- (void)applicationWillResignActive:(UIApplication *)application { - (void)applicationWillResignActive:(UIApplication *)application {
DDLogWarn(@"%@ applicationWillResignActive.", self.tag);
UIBackgroundTaskIdentifier __block bgTask = UIBackgroundTaskInvalid; UIBackgroundTaskIdentifier __block bgTask = UIBackgroundTaskInvalid;
bgTask = [application beginBackgroundTaskWithExpirationHandler:^{ bgTask = [application beginBackgroundTaskWithExpirationHandler:^{
@ -256,10 +270,10 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
if ([TSAccountManager isRegistered]) { if ([TSAccountManager isRegistered]) {
dispatch_sync(dispatch_get_main_queue(), ^{ dispatch_sync(dispatch_get_main_queue(), ^{
[self protectScreen]; [self protectScreen];
[[[Environment getCurrent] signalsViewController] updateInboxCountLabel]; [[[Environment getCurrent] signalsViewController] updateInboxCountLabel];
[TSSocketManager resignActivity];
}); });
[TSSocketManager resignActivity];
} }
[application endBackgroundTask:bgTask]; [application endBackgroundTask:bgTask];
@ -327,6 +341,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
[[PushManager sharedManager] application:application didReceiveRemoteNotification:userInfo]; [[PushManager sharedManager] application:application didReceiveRemoteNotification:userInfo];
} }
- (void)application:(UIApplication *)application - (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {

Loading…
Cancel
Save