blob: d815008caee48037bf55168bff7899196af800f6 [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
tkchind1fb26d2016-02-03 01:51:18 -080013#import "webrtc/base/objc/RTCTracing.h"
Donald E Curtisa8736442015-08-05 15:48:13 -070014#import "RTCLogging.h"
15#import "RTCPeerConnectionFactory.h"
16
17#import "ARDMainViewController.h"
18
19@implementation ARDAppDelegate {
20 UIWindow *_window;
21}
22
23#pragma mark - UIApplicationDelegate methods
24
25- (BOOL)application:(UIApplication *)application
26 didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
27 [RTCPeerConnectionFactory initializeSSL];
tkchind1fb26d2016-02-03 01:51:18 -080028 RTCSetupInternalTracer();
Donald E Curtisa8736442015-08-05 15:48:13 -070029 _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
30 [_window makeKeyAndVisible];
31 ARDMainViewController *viewController = [[ARDMainViewController alloc] init];
32 _window.rootViewController = viewController;
33
tfarinaa41ab932015-10-30 16:08:48 -070034#if defined(NDEBUG)
Donald E Curtisa8736442015-08-05 15:48:13 -070035 // In debug builds the default level is LS_INFO and in non-debug builds it is
36 // disabled. Continue to log to console in non-debug builds, but only
37 // warnings and errors.
38 RTCSetMinDebugLogLevel(kRTCLoggingSeverityWarning);
39#endif
40
41 return YES;
42}
43
44- (void)applicationWillResignActive:(UIApplication *)application {
45 ARDMainViewController *viewController =
46 (ARDMainViewController *)_window.rootViewController;
47 [viewController applicationWillResignActive:application];
48}
49
50- (void)applicationWillTerminate:(UIApplication *)application {
tkchind1fb26d2016-02-03 01:51:18 -080051 RTCShutdownInternalTracer();
Donald E Curtisa8736442015-08-05 15:48:13 -070052 [RTCPeerConnectionFactory deinitializeSSL];
53}
54
55@end