blob: aa99cc08c87b631d5de3bccaf78ab97f754026f2 [file] [log] [blame]
Donald E Curtisa8736442015-08-05 15:48:13 -07001/*
2 * Copyright 2013 The WebRTC Project Authors. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#import "ARDAppDelegate.h"
12
tkchin4f735d12016-03-03 17:54:28 -080013#import "webrtc/base/objc/RTCFieldTrials.h"
tkchind1fb26d2016-02-03 01:51:18 -080014#import "webrtc/base/objc/RTCTracing.h"
Donald E Curtisa8736442015-08-05 15:48:13 -070015#import "RTCLogging.h"
16#import "RTCPeerConnectionFactory.h"
17
18#import "ARDMainViewController.h"
19
20@implementation ARDAppDelegate {
21 UIWindow *_window;
22}
23
24#pragma mark - UIApplicationDelegate methods
25
26- (BOOL)application:(UIApplication *)application
27 didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
tkchin4f735d12016-03-03 17:54:28 -080028 RTCInitFieldTrials(RTCFieldTrialOptionsSendSideBwe);
Donald E Curtisa8736442015-08-05 15:48:13 -070029 [RTCPeerConnectionFactory initializeSSL];
tkchind1fb26d2016-02-03 01:51:18 -080030 RTCSetupInternalTracer();
Donald E Curtisa8736442015-08-05 15:48:13 -070031 _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
32 [_window makeKeyAndVisible];
33 ARDMainViewController *viewController = [[ARDMainViewController alloc] init];
34 _window.rootViewController = viewController;
35
tfarinaa41ab932015-10-30 16:08:48 -070036#if defined(NDEBUG)
Donald E Curtisa8736442015-08-05 15:48:13 -070037 // In debug builds the default level is LS_INFO and in non-debug builds it is
38 // disabled. Continue to log to console in non-debug builds, but only
39 // warnings and errors.
40 RTCSetMinDebugLogLevel(kRTCLoggingSeverityWarning);
41#endif
42
43 return YES;
44}
45
46- (void)applicationWillResignActive:(UIApplication *)application {
47 ARDMainViewController *viewController =
48 (ARDMainViewController *)_window.rootViewController;
49 [viewController applicationWillResignActive:application];
50}
51
52- (void)applicationWillTerminate:(UIApplication *)application {
tkchind1fb26d2016-02-03 01:51:18 -080053 RTCShutdownInternalTracer();
Donald E Curtisa8736442015-08-05 15:48:13 -070054 [RTCPeerConnectionFactory deinitializeSSL];
55}
56
57@end