2
0

Tag screens in Localytics + email fix + psc fix

[FIXED]     Sending email with no recipient caused a crash.
[FIXED]     Duplicate persistence coordinator.
[UPDATED]   Crashlytics and Localytics SDKs.
[UPDATED]   Don't continue the Localytics session when device locked.
[UPDATED]   Put Localytics communication on HTTPS for confidentiality.
[ADDED]     Tagging screens in Localytics.
This commit is contained in:
Maarten Billemont
2012-09-12 15:58:54 +02:00
parent 6f82cf7f15
commit bce6b96417
22 changed files with 2807 additions and 2509 deletions

View File

@@ -46,11 +46,7 @@
}];
}
if (![managedObjectContext.persistentStoreCoordinator.persistentStores count])
[managedObjectContext performBlockAndWait:^{
managedObjectContext.persistentStoreCoordinator = [self storeManager].persistentStoreCoordinator;
}];
[[self storeManager] persistentStoreCoordinator];
if (![self storeManager].isReady)
return nil;

View File

@@ -116,6 +116,7 @@
NSString *localyticsKey = [self localyticsKey];
if ([localyticsKey length]) {
inf(@"Initializing Localytics");
[LocalyticsSession sharedLocalyticsSession].enableHTTPS = YES;
[[LocalyticsSession sharedLocalyticsSession] startSession:localyticsKey];
[[PearlLogger get] registerListener:^BOOL(PearlLogMessage *message) {
if (message.level >= PearlLogLevelWarn)
@@ -321,23 +322,11 @@
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
wrn(@"Received memory warning.");
inf(@"Received memory warning.");
[super applicationDidReceiveMemoryWarning:application];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
inf(@"Re-activated");
[[MPAppDelegate get] checkConfig];
if (FBSession.activeSession.state == FBSessionStateCreatedOpening)
// An old Facebook Login session that wasn't finished. Clean it up.
[FBSession.activeSession close];
[super applicationDidBecomeActive:application];
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
[[LocalyticsSession sharedLocalyticsSession] close];
@@ -369,10 +358,31 @@
- (void)applicationWillResignActive:(UIApplication *)application {
inf(@"Will deactivate");
[self saveContext];
if (![[MPiOSConfig get].rememberLogin boolValue])
[self signOutAnimated:NO];
[[LocalyticsSession sharedLocalyticsSession] close];
[[LocalyticsSession sharedLocalyticsSession] upload];
[super applicationWillResignActive:application];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
inf(@"Re-activated");
[[MPAppDelegate get] checkConfig];
if (FBSession.activeSession.state == FBSessionStateCreatedOpening)
// An old Facebook Login session that wasn't finished. Clean it up.
[FBSession.activeSession close];
[[LocalyticsSession sharedLocalyticsSession] resume];
[[LocalyticsSession sharedLocalyticsSession] upload];
[super applicationDidBecomeActive:application];
}
#pragma mark - Behavior

View File

@@ -77,6 +77,13 @@
[super viewWillAppear:animated];
}
- (void)viewDidAppear:(BOOL)animated {
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Apps"];
[super viewDidAppear:animated];
}
- (void)viewWillDisappear:(BOOL)animated {
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];

View File

@@ -7,6 +7,7 @@
//
#import "MPGuideViewController.h"
#import "LocalyticsSession.h"
@implementation MPGuideViewController
@@ -35,6 +36,8 @@
- (void)viewDidAppear:(BOOL)animated {
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Guide"];
[super viewDidAppear:animated];
}

View File

@@ -149,7 +149,7 @@
inf(@"Main will appear");
// Sometimes, the search bar gets stuck in some sort of first-responder mode that it can't get out of...
[self.searchDisplayController.searchBar resignFirstResponder];
[[self.view.window findFirstResponderInHierarchy] resignFirstResponder];
// Needed for when we appear after a modal VC dismisses:
// We can't present until the other modal VC has been fully dismissed and presenting in viewDidAppear will fail.
@@ -204,6 +204,8 @@
}];
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Main"];
[super viewDidAppear:animated];
}
@@ -676,7 +678,7 @@
- (IBAction)action:(id)sender {
[PearlSheet showSheetWithTitle:nil message:nil viewStyle:UIActionSheetStyleAutomatic
[PearlSheet showSheetWithTitle:nil viewStyle:UIActionSheetStyleAutomatic
initSheet:nil
tappedButtonBlock:^(UIActionSheet *sheet, NSInteger buttonIndex) {
if (buttonIndex == [sheet cancelButtonIndex])

View File

@@ -11,6 +11,7 @@
#import "MPAppDelegate.h"
#import "MPAppDelegate_Key.h"
#import "MPAppDelegate_Store.h"
#import "LocalyticsSession.h"
@interface MPPreferencesViewController ()
@@ -80,6 +81,13 @@
[super viewWillAppear:animated];
}
- (void)viewDidAppear:(BOOL)animated {
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Preferences"];
[super viewDidAppear:animated];
}
- (void)viewWillDisappear:(BOOL)animated {
inf(@"Preferences will disappear");
@@ -152,6 +160,7 @@
vc.showDoneButton = NO;
[self.navigationController pushViewController:vc animated:YES];
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Settings"];
}
@end

View File

@@ -7,6 +7,7 @@
//
#import "MPTypeViewController.h"
#import "LocalyticsSession.h"
@interface MPTypeViewController ()
@@ -44,6 +45,8 @@
}
}];
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Type Selection"];
[super viewDidAppear:animated];
}

View File

@@ -16,6 +16,7 @@
#import "MPAppDelegate.h"
#import "MPAppDelegate_Key.h"
#import "MPAppDelegate_Store.h"
#import "LocalyticsSession.h"
@interface MPUnlockViewController ()
@@ -193,6 +194,8 @@
self.uiContainer.alpha = 1;
}];
[[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Unlock"];
[super viewDidAppear:animated];
}
@@ -749,7 +752,7 @@
return;
[PearlSheet showSheetWithTitle:targetedUser.name
message:nil viewStyle:UIActionSheetStyleBlackTranslucent
viewStyle:UIActionSheetStyleBlackTranslucent
initSheet:nil tappedButtonBlock:^(UIActionSheet *sheet, NSInteger buttonIndex) {
if (buttonIndex == [sheet cancelButtonIndex])
return;
@@ -823,7 +826,7 @@
- (IBAction)add:(UIButton *)sender {
[PearlSheet showSheetWithTitle:@"Follow Master Password" message:nil viewStyle:UIActionSheetStyleBlackTranslucent
[PearlSheet showSheetWithTitle:@"Follow Master Password" viewStyle:UIActionSheetStyleBlackTranslucent
initSheet:nil tappedButtonBlock:^(UIActionSheet *sheet, NSInteger buttonIndex) {
if (buttonIndex == [sheet cancelButtonIndex])
return;