2
0

Don't use Localytics or Crashlytics when disabled.

This commit is contained in:
Maarten Billemont 2013-08-25 18:49:13 -04:00
parent 2399156ee4
commit 72f0d69a71
11 changed files with 205 additions and 372 deletions

View File

@ -139,7 +139,7 @@ static NSDictionary *keyQuery(MPUserEntity *user) {
[Crashlytics setObjectValue:user.userID forKey:@"username"];
[Crashlytics setUserName:user.userID];
#endif
#if TARGET_OS_IPHONE
#ifdef LOCALYTICS
[[LocalyticsSession sharedLocalyticsSession] setCustomerName:user.userID];
#endif
}

View File

@ -73,8 +73,10 @@
- (void)viewDidAppear:(BOOL)animated {
#ifdef LOCALYTICS
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Apps"];
#endif
[self.pageViewController setViewControllers:@[ [self.pageVCs objectAtIndex:0] ] direction:UIPageViewControllerNavigationDirectionForward
animated:YES completion:nil];

View File

@ -67,7 +67,9 @@
- (void)viewDidAppear:(BOOL)animated {
#ifdef LOCALYTICS
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Guide"];
#endif
[super viewDidAppear:animated];
}

View File

@ -180,7 +180,9 @@
} );
}];
#ifdef LOCALYTICS
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Main"];
#endif
[super viewDidAppear:animated];
}

View File

@ -80,7 +80,9 @@
- (void)viewDidAppear:(BOOL)animated {
#ifdef LOCALYTICS
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Preferences"];
#endif
[super viewDidAppear:animated];
}

View File

@ -24,7 +24,9 @@
- (void)viewDidAppear:(BOOL)animated {
#ifdef LOCALYTICS
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Setup"];
#endif
[super viewDidAppear:animated];

View File

@ -43,7 +43,9 @@
}
}];
#ifdef LOCALYTICS
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Type Selection"];
#endif
[super viewDidAppear:animated];
}

View File

@ -231,7 +231,9 @@
[self.marqueeTipTimer invalidate];
self.marqueeTipTimer = [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(marqueeTip) userInfo:nil repeats:YES];
#ifdef LOCALYTICS
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Unlock"];
#endif
[super viewDidAppear:animated];
}

View File

@ -81,6 +81,7 @@
@catch (id exception) {
err(@"Google+: %@", exception);
}
#ifdef CRASHLYTICS
@try {
NSString *crashlyticsAPIKey = [self crashlyticsAPIKey];
if ([crashlyticsAPIKey length]) {
@ -110,6 +111,8 @@
@catch (id exception) {
err(@"Crashlytics: %@", exception);
}
#endif
#ifdef LOCALYTICS
@try {
NSString *localyticsKey = [self localyticsKey];
if ([localyticsKey length]) {
@ -134,6 +137,7 @@
@catch (id exception) {
err(@"Localytics exception: %@", exception);
}
#endif
UIImage *navBarImage = [[UIImage imageNamed:@"ui_navbar_container"] resizableImageWithCapInsets:UIEdgeInsetsMake( 0, 5, 0, 5 )];
[[UINavigationBar appearance] setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault];
@ -193,6 +197,7 @@
if ([PearlLogger get].printLevel > PearlLogLevelInfo)
[PearlLogger get].printLevel = PearlLogLevelInfo;
#ifdef CRASHLYTICS
[[Crashlytics sharedInstance] setBoolValue:[[MPConfig get].rememberLogin boolValue] forKey:@"rememberLogin"];
[[Crashlytics sharedInstance] setBoolValue:[self storeManager].cloudEnabled forKey:@"iCloud"];
[[Crashlytics sharedInstance] setBoolValue:[[MPConfig get].iCloudDecided boolValue] forKey:@"iCloudDecided"];
@ -205,6 +210,7 @@
[[Crashlytics sharedInstance]
setIntValue:[[PearlConfig get].reviewAfterLaunches intValue] forKey:@"reviewAfterLaunches"];
[[Crashlytics sharedInstance] setObjectValue:[PearlConfig get].reviewedVersion forKey:@"reviewedVersion"];
#endif
#ifdef TESTFLIGHT_SDK_VERSION
[TestFlight addCustomEnvironmentInformation:PearlStringNSB( [MPConfig get].rememberLogin )
@ -395,24 +401,30 @@
- (void)applicationDidEnterBackground:(UIApplication *)application {
#ifdef LOCALYTICS
[[LocalyticsSession sharedLocalyticsSession] close];
[[LocalyticsSession sharedLocalyticsSession] upload];
#endif
[super applicationDidEnterBackground:application];
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
#ifdef LOCALYTICS
[[LocalyticsSession sharedLocalyticsSession] resume];
[[LocalyticsSession sharedLocalyticsSession] upload];
#endif
[super applicationWillEnterForeground:application];
}
- (void)applicationWillTerminate:(UIApplication *)application {
#ifdef LOCALYTICS
[[LocalyticsSession sharedLocalyticsSession] close];
[[LocalyticsSession sharedLocalyticsSession] upload];
#endif
[super applicationWillTerminate:application];
}
@ -423,8 +435,10 @@
if (![[MPiOSConfig get].rememberLogin boolValue])
[self signOutAnimated:NO];
#ifdef LOCALYTICS
[[LocalyticsSession sharedLocalyticsSession] close];
[[LocalyticsSession sharedLocalyticsSession] upload];
#endif
[super applicationWillResignActive:application];
}
@ -434,8 +448,10 @@
inf(@"Re-activated");
[[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification object:application userInfo:nil];
#ifdef LOCALYTICS
[[LocalyticsSession sharedLocalyticsSession] resume];
[[LocalyticsSession sharedLocalyticsSession] upload];
#endif
[super applicationDidBecomeActive:application];
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body, html {
color: white;
font-family: 'Copperplate', sans-serif;
font-size: smaller;
text-align: center;
}
*:link, *:visited {
color: inherit;
font-weight: bold;
}
</style>
</head>
<body>
<p><a href="mailto:masterpassword@lyndir.com">E-mail us</a> or open <a href="http://masterpasswordapp.com/support.html">support</a> if you have any issues.</p>
</body>
</html>