From c0d57b556146d0e6549afbe9db8507a1077cbc4a Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Sat, 20 Apr 2013 13:51:37 -0400 Subject: [PATCH] MPCheckpoint [UPDATED] Refactoring of checkpoints. --- MasterPassword/ObjC/MPAppDelegate_Key.m | 15 +--- MasterPassword/ObjC/MPAppDelegate_Store.m | 38 ++------ MasterPassword/ObjC/MPTypes.h | 12 ++- MasterPassword/ObjC/iOS/MPAppDelegate.m | 65 ++++++-------- MasterPassword/ObjC/iOS/MPAppViewController.m | 14 ++- .../ObjC/iOS/MPAppsViewController.m | 6 +- .../ObjC/iOS/MPElementListController.m | 7 +- .../ObjC/iOS/MPMainViewController.m | 89 ++++++++----------- .../ObjC/iOS/MPUnlockViewController.m | 11 +-- 9 files changed, 96 insertions(+), 161 deletions(-) diff --git a/MasterPassword/ObjC/MPAppDelegate_Key.m b/MasterPassword/ObjC/MPAppDelegate_Key.m index 5a0594a0..ebd648fe 100644 --- a/MasterPassword/ObjC/MPAppDelegate_Key.m +++ b/MasterPassword/ObjC/MPAppDelegate_Key.m @@ -126,13 +126,7 @@ static NSDictionary *keyQuery(MPUserEntity *user) { if (!tryKey) { if (password) { inf(@"Login failed for: %@", user.userID); - -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointSignInFailed]; -#endif -#ifdef LOCALYTICS - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointSignInFailed attributes:nil]; -#endif + MPCheckpoint( MPCheckpointSignInFailed, nil ); } return NO; @@ -164,12 +158,7 @@ static NSDictionary *keyQuery(MPUserEntity *user) { self.activeUser = user; [[NSNotificationCenter defaultCenter] postNotificationName:MPSignedInNotification object:self]; -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointSignedIn]; -#endif -#ifdef LOCALYTICS - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointSignedIn attributes:nil]; -#endif + MPCheckpoint( MPCheckpointSignedIn, nil ); return YES; } diff --git a/MasterPassword/ObjC/MPAppDelegate_Store.m b/MasterPassword/ObjC/MPAppDelegate_Store.m index a77ae4f8..f7f0d01b 100644 --- a/MasterPassword/ObjC/MPAppDelegate_Store.m +++ b/MasterPassword/ObjC/MPAppDelegate_Store.m @@ -333,15 +333,9 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, isCloud:(BOOL)isCloudStore { inf(@"Using iCloud? %@", @(isCloudStore)); - -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:isCloudStore? MPCheckpointCloudEnabled: MPCheckpointCloudDisabled]; -#endif -#ifdef LOCALYTICS - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointCloud attributes:@{ - @"enabled": @(isCloudStore) - }]; -#endif + MPCheckpoint( MPCheckpointCloud, @{ + @"enabled" : @(isCloudStore) + } ); // Create our contexts. NSManagedObjectContext *privateManagedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; @@ -365,17 +359,11 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, context:(id)context { err(@"[StoreManager] ERROR: cause=%d, context=%@, error=%@", cause, context, error); - -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:PearlString( MPCheckpointMPErrorUbiquity @"_%d", cause )]; -#endif -#ifdef LOCALYTICS - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointMPErrorUbiquity attributes:@{ + MPCheckpoint( MPCheckpointMPErrorUbiquity, @{ @"cause" : @(cause), @"error.domain" : error.domain, @"error.code" : @(error.code) - }]; -#endif + } ); } - (BOOL)ubiquityStoreManager:(UbiquityStoreManager *)manager handleCloudContentCorruptionWithHealthyStore:(BOOL)storeHealthy { @@ -622,12 +610,7 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, } inf(@"Import completed successfully."); -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointSitesImported]; -#endif -#ifdef LOCALYTICS - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointSitesImported attributes:nil]; -#endif + MPCheckpoint( MPCheckpointSitesImported, nil ); return MPImportResultSuccess; } @@ -683,12 +666,9 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, ? content: @""]; } -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointSitesExported]; -#endif -#ifdef LOCALYTICS - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointSitesExported attributes:nil]; -#endif + MPCheckpoint( MPCheckpointSitesExported, @{ + @"showPasswords" : @(showPasswords) + } ); return export; } diff --git a/MasterPassword/ObjC/MPTypes.h b/MasterPassword/ObjC/MPTypes.h index 9ddc34fc..5d2d712b 100644 --- a/MasterPassword/ObjC/MPTypes.h +++ b/MasterPassword/ObjC/MPTypes.h @@ -61,18 +61,22 @@ typedef enum { #define MPCheckpointSignedIn @"MPCheckpointSignedIn" #define MPCheckpointConfig @"MPCheckpointConfig" #define MPCheckpointCloud @"MPCheckpointCloud" -#define MPCheckpointCloudEnabled @"MPCheckpointCloudEnabled" -#define MPCheckpointCloudDisabled @"MPCheckpointCloudDisabled" #define MPCheckpointSitesImported @"MPCheckpointSitesImported" #define MPCheckpointSitesExported @"MPCheckpointSitesExported" #define MPCheckpointExplicitMigration @"MPCheckpointExplicitMigration" #define MPCheckpointReview @"MPCheckpointReview" #define MPCheckpointApps @"MPCheckpointApps" -#define MPCheckpointAppGorillas @"MPCheckpointAppGorillas" -#define MPCheckpointAppDeBlock @"MPCheckpointAppDeBlock" +#define MPCheckpointApp @"MPCheckpointApp" #define MPSignedInNotification @"MPSignedInNotification" #define MPSignedOutNotification @"MPSignedOutNotification" #define MPKeyForgottenNotification @"MPKeyForgottenNotification" #define MPElementUpdatedNotification @"MPElementUpdatedNotification" #define MPCheckConfigNotification @"MPCheckConfigNotification" + +static void MPCheckpoint(NSString *checkpoint, NSDictionary *attributes) { + +#ifdef LOCALYTICS + [[LocalyticsSession sharedLocalyticsSession] tagEvent:checkpoint attributes:attributes]; +#endif +} diff --git a/MasterPassword/ObjC/iOS/MPAppDelegate.m b/MasterPassword/ObjC/iOS/MPAppDelegate.m index 85d9131d..d618a8b2 100644 --- a/MasterPassword/ObjC/iOS/MPAppDelegate.m +++ b/MasterPassword/ObjC/iOS/MPAppDelegate.m @@ -48,10 +48,10 @@ #endif [TestFlight addCustomEnvironmentInformation:@"Anonymous" forKey:@"username"]; [TestFlight addCustomEnvironmentInformation:[PearlKeyChain deviceIdentifier] forKey:@"deviceIdentifier"]; - [TestFlight setOptions:[NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:NO], @"logToConsole", - [NSNumber numberWithBool:NO], @"logToSTDERR", - nil]]; + [TestFlight setOptions:@{ + @"logToConsole" : @NO, + @"logToSTDERR" : @NO + }]; [TestFlight takeOff:testFlightToken]; [[PearlLogger get] registerListener:^BOOL(PearlLogMessage *message) { PearlLogLevel level = PearlLogLevelWarn; @@ -120,11 +120,10 @@ [[LocalyticsSession sharedLocalyticsSession] upload]; [[PearlLogger get] registerListener:^BOOL(PearlLogMessage *message) { if (message.level >= PearlLogLevelWarn) - [[LocalyticsSession sharedLocalyticsSession] tagEvent:@"Problem" - attributes:@{ - @"level": @(PearlLogLevelStr(message.level)), - @"message": message.message - }]; + MPCheckpoint( @"Problem", @{ + @"level" : @(PearlLogLevelStr( message.level )), + @"message" : message.message + } ); return YES; }]; @@ -220,22 +219,20 @@ forKey:@"askForReviews"]; [TestFlight addCustomEnvironmentInformation:[[PearlConfig get].reviewAfterLaunches description] forKey:@"reviewAfterLaunches"]; [TestFlight addCustomEnvironmentInformation:[PearlConfig get].reviewedVersion forKey:@"reviewedVersion"]; - - [TestFlight passCheckpoint:MPCheckpointConfig]; #endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointConfig attributes:@{ - @"rememberLogin" : [[MPConfig get].rememberLogin boolValue]? @"YES": @"NO", - @"iCloud" : [self storeManager].cloudEnabled? @"YES": @"NO", - @"iCloudDecided" : [[MPConfig get].iCloudDecided boolValue]? @"YES": @"NO", - @"sendInfo" : [[MPiOSConfig get].sendInfo boolValue]? @"YES": @"NO", - @"helpHidden" : [[MPiOSConfig get].helpHidden boolValue]? @"YES": @"NO", - @"showQuickStart" : [[MPiOSConfig get].showSetup boolValue]? @"YES": @"NO", - @"firstRun" : [[PearlConfig get].firstRun boolValue]? @"YES": @"NO", - @"launchCount" : NilToNSNull([[PearlConfig get].launchCount description]), - @"askForReviews" : [[PearlConfig get].askForReviews boolValue]? @"YES": @"NO", - @"reviewAfterLaunches" : NilToNSNull([[PearlConfig get].reviewAfterLaunches description]), - @"reviewedVersion" : NilToNSNull([PearlConfig get].reviewedVersion) - }]; + MPCheckpoint( MPCheckpointConfig, @{ + @"rememberLogin" : [[MPConfig get].rememberLogin boolValue]? @"YES": @"NO", + @"iCloud" : [self storeManager].cloudEnabled? @"YES": @"NO", + @"iCloudDecided" : [[MPConfig get].iCloudDecided boolValue]? @"YES": @"NO", + @"sendInfo" : [[MPiOSConfig get].sendInfo boolValue]? @"YES": @"NO", + @"helpHidden" : [[MPiOSConfig get].helpHidden boolValue]? @"YES": @"NO", + @"showQuickStart" : [[MPiOSConfig get].showSetup boolValue]? @"YES": @"NO", + @"firstRun" : [[PearlConfig get].firstRun boolValue]? @"YES": @"NO", + @"launchCount" : NilToNSNull([[PearlConfig get].launchCount description]), + @"askForReviews" : [[PearlConfig get].askForReviews boolValue]? @"YES": @"NO", + @"reviewAfterLaunches" : NilToNSNull([[PearlConfig get].reviewAfterLaunches description]), + @"reviewedVersion" : NilToNSNull([PearlConfig get].reviewedVersion) + } ); } }]; [[NSNotificationCenter defaultCenter] addObserverForName:kIASKAppSettingChanged object:nil queue:nil @@ -429,20 +426,14 @@ [self.navigationController performSegueWithIdentifier:@"MP_Guide" sender:self]; -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointShowGuide]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointShowGuide attributes:nil]; + MPCheckpoint( MPCheckpointShowGuide, nil ); } - (void)showSetup { [self.navigationController performSegueWithIdentifier:@"MP_Setup" sender:self]; -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointShowSetup]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointShowSetup attributes:nil]; + MPCheckpoint( MPCheckpointShowSetup, nil ); } - (void)showFeedback { @@ -452,10 +443,7 @@ - (void)showReview { -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointReview]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointReview attributes:nil]; + MPCheckpoint( MPCheckpointReview, nil ); [super showReview]; } @@ -605,10 +593,7 @@ if (didReset) didReset(); -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointChangeMP]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointChangeMP attributes:nil]; + MPCheckpoint( MPCheckpointChangeMP, nil ); } cancelTitle:[PearlStrings get].commonButtonAbort otherTitles:[PearlStrings get].commonButtonContinue, nil]; diff --git a/MasterPassword/ObjC/iOS/MPAppViewController.m b/MasterPassword/ObjC/iOS/MPAppViewController.m index f0c410a5..bafaa803 100644 --- a/MasterPassword/ObjC/iOS/MPAppViewController.m +++ b/MasterPassword/ObjC/iOS/MPAppViewController.m @@ -25,20 +25,18 @@ - (IBAction)gorillas:(UIButton *)sender { -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointAppGorillas]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointAppGorillas attributes:nil]; + MPCheckpoint( MPCheckpointApp, @{ + @"app" : @"gorillas" + } ); [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://itunes.apple.com/app/lyndir/gorillas/id302275459?mt=8"]]; } - (IBAction)deblock:(UIButton *)sender { -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointAppDeBlock]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointAppDeBlock attributes:nil]; + MPCheckpoint( MPCheckpointApp, @{ + @"app": @"deblock" + } ); [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://itunes.apple.com/app/lyndir/deblock/id325058485?mt=8"]]; } diff --git a/MasterPassword/ObjC/iOS/MPAppsViewController.m b/MasterPassword/ObjC/iOS/MPAppsViewController.m index b0b0d78a..8c30430a 100644 --- a/MasterPassword/ObjC/iOS/MPAppsViewController.m +++ b/MasterPassword/ObjC/iOS/MPAppsViewController.m @@ -66,11 +66,7 @@ - (void)viewWillAppear:(BOOL)animated { [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; - -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointApps]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointApps attributes:nil]; + MPCheckpoint( MPCheckpointApps, nil ); [self.pageViewController setViewControllers:@[ [self.pageVCs objectAtIndex:1] ] direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil]; diff --git a/MasterPassword/ObjC/iOS/MPElementListController.m b/MasterPassword/ObjC/iOS/MPElementListController.m index 89767a5d..76429d19 100644 --- a/MasterPassword/ObjC/iOS/MPElementListController.m +++ b/MasterPassword/ObjC/iOS/MPElementListController.m @@ -289,13 +289,10 @@ forRowAtIndexPath:(NSIndexPath *)indexPath { [element.managedObjectContext deleteObject:element]; [element.managedObjectContext saveToStore]; -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointDeleteElement]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointDeleteElement attributes:@{ + MPCheckpoint( MPCheckpointDeleteElement, @{ @"type" : element.typeName, @"version" : @(element.version) - }]; + }); }]; } } diff --git a/MasterPassword/ObjC/iOS/MPMainViewController.m b/MasterPassword/ObjC/iOS/MPMainViewController.m index 846463b7..8a7a9491 100644 --- a/MasterPassword/ObjC/iOS/MPMainViewController.m +++ b/MasterPassword/ObjC/iOS/MPMainViewController.m @@ -310,10 +310,9 @@ - (void)setHelpChapter:(NSString *)chapter { -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:PearlString(MPCheckpointHelpChapter @"_%@", chapter)]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointHelpChapter attributes:@{@"chapter": chapter}]; + MPCheckpoint( MPCheckpointHelpChapter, @{ + @"chapter" : chapter + } ); dispatch_async(dispatch_get_main_queue(), ^{ NSURL *url = [NSURL URLWithString:[@"#" stringByAppendingString:chapter] @@ -471,11 +470,11 @@ [self showContentTip:@"Copied!" withIcon:nil]; -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointCopyToPasteboard]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointCopyToPasteboard attributes:@{@"type" : activeElement.typeName, - @"version" : @(activeElement.version)}]; + MPCheckpoint( MPCheckpointCopyToPasteboard, @{ + @"type" : activeElement.typeName, + @"version" : @(activeElement.version), + @"emergency" : @NO + } ); } - (IBAction)copyLoginName:(UITapGestureRecognizer *)sender { @@ -489,12 +488,10 @@ [self showLoginNameTip:@"Copied!"]; -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointCopyLoginNameToPasteboard]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointCopyLoginNameToPasteboard - attributes:@{@"type" : activeElement.typeName, - @"version" : @(activeElement.version)}]; + MPCheckpoint( MPCheckpointCopyLoginNameToPasteboard, @{ + @"type" : activeElement.typeName, + @"version" : @(activeElement.version) + } ); } - (IBAction)incrementPasswordCounter { @@ -510,16 +507,16 @@ err(@"Cannot increment password counter: Element is not generated: %@", activeElement.name); return NO; } + MPElementGeneratedEntity *activeGeneratedElement = (MPElementGeneratedEntity *)activeElement; - inf(@"Incrementing password counter for: %@", activeElement.name); - ++((MPElementGeneratedEntity *)activeElement).counter; + inf(@"Incrementing password counter for: %@", activeGeneratedElement.name); + ++activeGeneratedElement.counter; -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointIncrementPasswordCounter]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointIncrementPasswordCounter - attributes:@{@"type": activeElement.typeName, - @"version": @(activeElement.version)}]; + MPCheckpoint( MPCheckpointIncrementPasswordCounter, @{ + @"type" : activeGeneratedElement.typeName, + @"version" : @(activeGeneratedElement.version), + @"counter" : @(activeGeneratedElement.counter) + } ); return YES; }]; } @@ -547,12 +544,10 @@ inf(@"Resetting password counter for: %@", activeElement_.name); ((MPElementGeneratedEntity *)activeElement_).counter = 1; -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointResetPasswordCounter]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointResetPasswordCounter - attributes:@{@"type": activeElement_.typeName, - @"version": @(activeElement_.version)}]; + MPCheckpoint( MPCheckpointResetPasswordCounter, @{ + @"type" : activeElement_.typeName, + @"version" : @(activeElement_.version) + } ); return YES; }]; } @@ -570,11 +565,10 @@ self.loginNameField.enabled = YES; [self.loginNameField becomeFirstResponder]; -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointEditLoginName]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointEditLoginName attributes:@{@"type" : activeElement.typeName, - @"version" : @(activeElement.version)}]; + MPCheckpoint( MPCheckpointEditLoginName, @{ + @"type" : activeElement.typeName, + @"version" : @(activeElement.version) + } ); } - (void)changeActiveElementWithWarning:(NSString *)warning do:(BOOL (^)(MPElementEntity *activeElement))task; { @@ -644,11 +638,10 @@ self.contentField.enabled = YES; [self.contentField becomeFirstResponder]; -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointEditPassword]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointEditPassword attributes:@{@"type" : activeElement.typeName, - @"version" : @(activeElement.version)}]; + MPCheckpoint( MPCheckpointEditPassword, @{ + @"type" : activeElement.typeName, + @"version" : @(activeElement.version) + } ); } - (IBAction)upgradePassword { @@ -670,13 +663,10 @@ inf(@"Explicitly migrating element: %@", activeElement_); [activeElement_ migrateExplicitly:YES]; -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointExplicitMigration]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointExplicitMigration attributes:@{ + MPCheckpoint( MPCheckpointExplicitMigration, @{ @"type" : activeElement_.typeName, @"version" : @(activeElement_.version) - }]; + } ); return YES; }]; } @@ -849,12 +839,11 @@ [self.searchDisplayController setActive:NO animated:YES]; self.searchDisplayController.searchBar.text = activeElement.name; - [[NSNotificationCenter defaultCenter] postNotificationName:MPElementUpdatedNotification object:activeElement.objectID]; -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:PearlString(MPCheckpointUseType @"_%@", activeElement.typeShortName)]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointUseType attributes:@{@"type" : activeElement.typeName, - @"version" : @(activeElement.version)}]; + MPCheckpoint( MPCheckpointUseType, @{ + @"type" : activeElement.typeName, + @"version" : @(activeElement.version) + } ); + [self updateAnimated:YES]; } diff --git a/MasterPassword/ObjC/iOS/MPUnlockViewController.m b/MasterPassword/ObjC/iOS/MPUnlockViewController.m index 92ce773b..3cb7a98f 100644 --- a/MasterPassword/ObjC/iOS/MPUnlockViewController.m +++ b/MasterPassword/ObjC/iOS/MPUnlockViewController.m @@ -897,14 +897,11 @@ } }]; -#ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointCopyToPasteboard]; -#endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointCopyToPasteboard attributes:@{ - @"type" : [MPAlgorithmDefault nameOfType:self.emergencyType], - @"version" : @MPAlgorithmDefaultVersion, + MPCheckpoint( MPCheckpointCopyToPasteboard, @{ + @"type" : [MPAlgorithmDefault nameOfType:self.emergencyType], + @"version" : @MPAlgorithmDefaultVersion, @"emergency" : @YES, - }]; + } ); } - (void)emergencyCloseAnimated:(BOOL)animated {