Skip to content

Commit 9a03d1c

Browse files
author
Mike Amaral
committed
More app delegate cleanup.
1 parent 2079456 commit 9a03d1c

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

Source/App Delegate/AppDelegate.m

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,22 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
3232

3333
application.applicationIconBadgeNumber = 0;
3434

35-
[ThemeManager setupTheme];
36-
37-
[Fabric with:@[CrashlyticsKit]];
38-
39-
[self initializeAnalytics];
35+
[self setupThirdPartyLibraries];
4036
[self setupPushNotifications];
4137

4238
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[ComicListViewController new]];
43-
4439
[self.window makeKeyAndVisible];
4540

4641
return YES;
4742
}
4843

49-
- (void)applicationWillEnterForeground:(UIApplication *)application {
50-
[[GTTracker sharedInstance] startAnalyticsSession];
51-
}
5244

53-
- (void)applicationDidEnterBackground:(UIApplication *)application {
54-
[[GTTracker sharedInstance] endAnalyticsSession];
55-
}
45+
#pragma mark - Third-party library setup
5646

57-
- (void)applicationWillTerminate:(UIApplication *)application {
58-
[[GTTracker sharedInstance] endAnalyticsSession];
47+
- (void)setupThirdPartyLibraries {
48+
[ThemeManager setupTheme];
49+
[Fabric with:@[CrashlyticsKit]];
50+
[[GTTracker sharedInstance] initializeAnalyticsWithTrackingID:kAnalyticsTrackingID logLevel:kGAILogLevelError];
5951
}
6052

6153

@@ -85,14 +77,4 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(N
8577
[[DataManager sharedInstance] performBackgroundFetchWithCompletionHandler:completionHandler];
8678
}
8779

88-
89-
#pragma mark - Analytics
90-
91-
- (void)initializeAnalytics {
92-
// Start up the GTTracker.
93-
GTTracker *tracker = [GTTracker sharedInstance];
94-
tracker.loggingEnabled = NO;
95-
[tracker initializeAnalyticsWithTrackingID:kAnalyticsTrackingID logLevel:kGAILogLevelError];
96-
}
97-
9880
@end

0 commit comments

Comments
 (0)