blob: 20ae170b9a2375ad30ec9ab95e7255c13836408e [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
tkchin9eeb6242016-04-27 01:54:20 -070013#import "WebRTC/RTCFieldTrials.h"
14#import "WebRTC/RTCLogging.h"
15#import "WebRTC/RTCSSLAdapter.h"
16#import "WebRTC/RTCTracing.h"
Donald E Curtisa8736442015-08-05 15:48:13 -070017
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 {
tkchin4cd62212016-12-15 13:17:54 -080028 NSDictionary *fieldTrials = @{
Alex Naresta5fbc232017-10-18 18:31:07 +020029 kRTCFieldTrialH264HighProfileKey : kRTCFieldTrialEnabledValue,
30 kRTCFieldTrialAudioSendSideBweKey : kRTCFieldTrialEnabledValue
tkchin4cd62212016-12-15 13:17:54 -080031 };
32 RTCInitFieldTrialDictionary(fieldTrials);
hjon79858f82016-03-13 22:08:26 -070033 RTCInitializeSSL();
tkchind1fb26d2016-02-03 01:51:18 -080034 RTCSetupInternalTracer();
Donald E Curtisa8736442015-08-05 15:48:13 -070035 _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
36 [_window makeKeyAndVisible];
37 ARDMainViewController *viewController = [[ARDMainViewController alloc] init];
denicija6d6762c2016-10-28 04:53:16 -070038
39 UINavigationController *root =
40 [[UINavigationController alloc] initWithRootViewController:viewController];
41 root.navigationBar.translucent = NO;
42 _window.rootViewController = root;
Donald E Curtisa8736442015-08-05 15:48:13 -070043
tfarinaa41ab932015-10-30 16:08:48 -070044#if defined(NDEBUG)
Donald E Curtisa8736442015-08-05 15:48:13 -070045 // In debug builds the default level is LS_INFO and in non-debug builds it is
46 // disabled. Continue to log to console in non-debug builds, but only
47 // warnings and errors.
tkchin8b9ca952016-03-31 12:08:03 -070048 RTCSetMinDebugLogLevel(RTCLoggingSeverityWarning);
Donald E Curtisa8736442015-08-05 15:48:13 -070049#endif
50
51 return YES;
52}
53
Donald E Curtisa8736442015-08-05 15:48:13 -070054- (void)applicationWillTerminate:(UIApplication *)application {
tkchind1fb26d2016-02-03 01:51:18 -080055 RTCShutdownInternalTracer();
hjon79858f82016-03-13 22:08:26 -070056 RTCCleanupSSL();
Donald E Curtisa8736442015-08-05 15:48:13 -070057}
58
59@end