diff options
author | Ilya Grechuhin <i.grechuhin@mapswithme.com> | 2015-08-10 19:10:43 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:00:33 +0300 |
commit | fdbb4b5154e3c540f51bfbef93a2a748410a8c85 (patch) | |
tree | d112b44f296fb2992a06137521398f825d340519 /iphone/Maps/Classes/CustomAlert | |
parent | f8deb26569dcb51e32690876969355adb471bf7b (diff) |
[ios] Added flurry logging to dialogs.
Diffstat (limited to 'iphone/Maps/Classes/CustomAlert')
9 files changed, 57 insertions, 8 deletions
diff --git a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm index 2408d4abb7..c88ca66132 100644 --- a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm @@ -17,6 +17,7 @@ #import "MWMPedestrianShareAlert.h" #import "MWMRateAlert.h" #import "MWMRoutingDisclaimerAlert.h" +#import "Statistics.h" @implementation MWMAlert diff --git a/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.mm b/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.mm index 4231b1d847..d336e95185 100644 --- a/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.mm @@ -12,6 +12,7 @@ #import "MWMAlertViewController.h" #import "MWMDefaultAlert.h" #import "MWMPlacePageViewManager.h" +#import "Statistics.h" #import "UIButton+RuntimeAttributes.h" #import "UIKitCategories.h" #import "UILabel+RuntimeAttributes.h" @@ -38,22 +39,26 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; + (instancetype)routeFileNotExistAlert { + [Statistics.instance logEvent:@"Route File Not Exist Alert - open"]; return [self defaultAlertWithTitle:@"dialog_routing_download_files" message:@"dialog_routing_download_and_update_all" rightButtonTitle:@"ok" leftButtonTitle:nil rightButtonAction:nil]; } + (instancetype)routeNotFoundAlert { + [Statistics.instance logEvent:@"Route Not Found Alert - open"]; NSString * message = [NSString stringWithFormat:@"%@\n\n%@", L(@"dialog_routing_cant_build_route"), L(@"dialog_routing_change_start_or_end")]; return [self defaultAlertWithTitle:@"dialog_routing_unable_locate_route" message:message rightButtonTitle:@"ok" leftButtonTitle:nil rightButtonAction:nil]; } + (instancetype)locationServiceNotSupportedAlert { + [Statistics.instance logEvent:@"Location Service Not Supported Alert - open"]; return [self defaultAlertWithTitle:@"device_doesnot_support_location_services" message:nil rightButtonTitle:@"ok" leftButtonTitle:nil rightButtonAction:nil]; } + (instancetype)noConnectionAlert { + [Statistics.instance logEvent:@"No Connection Alert - open"]; MWMDefaultAlert * alert = [self defaultAlertWithTitle:@"no_internet_connection_detected" message:nil rightButtonTitle:@"ok" leftButtonTitle:nil rightButtonAction:nil]; [alert setNeedsCloseAlertAfterEnterBackground]; return alert; @@ -61,6 +66,7 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; + (instancetype)noWiFiAlertWithName:(NSString *)name downloadBlock:(RightButtonAction)block { + [Statistics.instance logEvent:@"No WiFi Alert - open"]; MWMDefaultAlert * alert = [self defaultAlertWithTitle:name message:nil rightButtonTitle:@"use_cellular_data" leftButtonTitle:@"cancel" rightButtonAction:block]; [alert setNeedsCloseAlertAfterEnterBackground]; return alert; @@ -68,30 +74,35 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; + (instancetype)endPointNotFoundAlert { + [Statistics.instance logEvent:@"End Point Not Found Alert - open"]; NSString * message = [NSString stringWithFormat:@"%@\n\n%@", L(@"dialog_routing_end_not_determined"), L(@"dialog_routing_select_closer_end")]; return [self defaultAlertWithTitle:@"dialog_routing_change_end" message:message rightButtonTitle:@"ok" leftButtonTitle:nil rightButtonAction:nil]; } + (instancetype)startPointNotFoundAlert { + [Statistics.instance logEvent:@"Start Point Not Found Alert - open"]; NSString * message = [NSString stringWithFormat:@"%@\n\n%@", L(@"dialog_routing_start_not_determined"), L(@"dialog_routing_select_closer_start")]; return [self defaultAlertWithTitle:@"dialog_routing_change_start" message:message rightButtonTitle:@"ok" leftButtonTitle:nil rightButtonAction:nil]; } + (instancetype)internalErrorAlert { + [Statistics.instance logEvent:@"Internal Error Alert - open"]; NSString * message = [NSString stringWithFormat:@"%@\n\n%@", L(@"dialog_routing_application_error"), L(@"dialog_routing_try_again")]; return [self defaultAlertWithTitle:@"dialog_routing_system_error" message:message rightButtonTitle:@"ok" leftButtonTitle:nil rightButtonAction:nil]; } + (instancetype)noCurrentPositionAlert { + [Statistics.instance logEvent:@"No Current Position Alert - open"]; NSString * message = [NSString stringWithFormat:@"%@\n\n%@", L(@"dialog_routing_error_location_not_found"), L(@"dialog_routing_location_turn_wifi")]; return [self defaultAlertWithTitle:@"dialog_routing_check_gps" message:message rightButtonTitle:@"OK" leftButtonTitle:nil rightButtonAction:nil]; } + (instancetype)disabledLocationAlert { + [Statistics.instance logEvent:@"Disabled Location Alert - open"]; RightButtonAction action = ^ { GetFramework().GetLocationState()->SwitchToNextMode(); @@ -101,11 +112,13 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; + (instancetype)pointsInDifferentMWMAlert { + [Statistics.instance logEvent:@"Points In Different MWM Alert - open"]; return [self defaultAlertWithTitle:@"routing_failed_cross_mwm_building" message:nil rightButtonTitle:@"ok" leftButtonTitle:nil rightButtonAction:nil]; } + (instancetype)defaultAlertWithTitle:(nonnull NSString *)title message:(nullable NSString *)message rightButtonTitle:(nonnull NSString *)rightButtonTitle leftButtonTitle:(nullable NSString *)leftButtonTitle rightButtonAction:(nullable RightButtonAction)action { + [Statistics.instance logEvent:[NSString stringWithFormat:@"Default Alert With Title:%@ - %@", title, @"open"]]; MWMDefaultAlert * alert = [[[NSBundle mainBundle] loadNibNamed:kDefaultAlertNibName owner:self options:nil] firstObject]; alert.titleLabel.localizedText = title; alert.messageLabel.localizedText = message; @@ -132,6 +145,7 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; - (IBAction)rightButtonTap { + [Statistics.instance logEvent:@"Default Alert - rightButtonTap"]; if (self.rightButtonAction) self.rightButtonAction(); [self close]; @@ -139,6 +153,7 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; - (IBAction)leftButtonTap { + [Statistics.instance logEvent:@"Default Alert - leftButtonTap"]; [self close]; } diff --git a/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm b/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm index 97357d696d..8f1a3660cb 100644 --- a/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm @@ -12,6 +12,7 @@ #import "MWMDownloaderDialogCell.h" #import "MWMDownloaderDialogHeader.h" #import "MWMDownloadTransitMapAlert.h" +#import "Statistics.h" #import "UIColor+MapsMeColor.h" #import "UIKitCategories.h" #import "UILabel+RuntimeAttributes.h" @@ -67,6 +68,8 @@ static CGFloat const kHeaderHeight = 43.; static CGFloat const kHeaderAndFooterHeight = 44.; static CGFloat const kMinimumOffset = 20.; +static NSString * const kStatisticsEvent = @"Map download Alert"; + @interface MWMDownloadTransitMapAlert () { vector<storage::TIndex> maps; @@ -95,6 +98,7 @@ static CGFloat const kMinimumOffset = 20.; routes:(vector<storage::TIndex> const &)routes code:(routing::IRouter::ResultCode)code { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kStatisticsEvent, @"open"]]; MWMDownloadTransitMapAlert * alert = [self alertWithMaps:maps routes:routes]; switch (code) { @@ -161,11 +165,13 @@ static CGFloat const kMinimumOffset = 20.; - (IBAction)notNowButtonTap:(id)sender { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kStatisticsEvent, @"notNowButtonTap"]]; [self close]; } - (IBAction)downloadButtonTap:(id)sender { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kStatisticsEvent, @"downloadButtonTap"]]; [self downloadMaps]; } diff --git a/iphone/Maps/Classes/CustomAlert/FacebookAlert/MWMFacebookAlert.mm b/iphone/Maps/Classes/CustomAlert/FacebookAlert/MWMFacebookAlert.mm index 26074248fe..7d11409bd1 100644 --- a/iphone/Maps/Classes/CustomAlert/FacebookAlert/MWMFacebookAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/FacebookAlert/MWMFacebookAlert.mm @@ -6,11 +6,11 @@ // Copyright (c) 2015 MapsWithMe. All rights reserved. // -#import "MWMFacebookAlert.h" #import "MWMAlertViewController.h" +#import "MWMFacebookAlert.h" +#import "Statistics.h" #import <FBSDKShareKit/FBSDKShareKit.h> -#import "Statistics.h" #import "3party/Alohalytics/src/alohalytics_objc.h" static NSString * const kFacebookAlertNibName = @"MWMFacebookAlert"; @@ -25,6 +25,7 @@ extern NSString * const kUDAlreadySharedKey; + (MWMFacebookAlert *)alert { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kFacebookInviteEventName, @"open"]]; MWMFacebookAlert * alert = [[[NSBundle mainBundle] loadNibNamed:kFacebookAlertNibName owner:self options:nil] firstObject]; return alert; } diff --git a/iphone/Maps/Classes/CustomAlert/FeedbackAlert/MWMFeedbackAlert.mm b/iphone/Maps/Classes/CustomAlert/FeedbackAlert/MWMFeedbackAlert.mm index d0b81e0b8e..50367cfaa9 100644 --- a/iphone/Maps/Classes/CustomAlert/FeedbackAlert/MWMFeedbackAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/FeedbackAlert/MWMFeedbackAlert.mm @@ -6,12 +6,15 @@ // Copyright (c) 2015 MapsWithMe. All rights reserved. // -#import "MWMFeedbackAlert.h" +#import "AppInfo.h" #import "MWMAlertViewController.h" -#import <MessageUI/MFMailComposeViewController.h> +#import "MWMFeedbackAlert.h" +#import "Statistics.h" #import "UIKitCategories.h" -#import "AppInfo.h" + +#import <MessageUI/MFMailComposeViewController.h> #import <sys/utsname.h> + #import "3party/Alohalytics/src/alohalytics_objc.h" #include "platform/platform.hpp" @@ -32,6 +35,7 @@ extern NSString * const kRateAlertEventName; + (instancetype)alertWithStarsCount:(NSUInteger)starsCount { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kRateAlertEventName, @"open"]]; MWMFeedbackAlert * alert = [[[NSBundle mainBundle] loadNibNamed:kFeedbackAlertNibName owner:self options:nil] firstObject]; alert.starsCount = starsCount; return alert; @@ -48,6 +52,7 @@ extern NSString * const kRateAlertEventName; - (IBAction)writeFeedbackButtonTap:(id)sender { [Alohalytics logEvent:kRateAlertEventName withValue:@"feedbackWriteTap"]; + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kRateAlertEventName, @"feedbackWriteTap"]]; self.alpha = 0.; self.alertController.view.alpha = 0.; if ([MFMailComposeViewController canSendMail]) @@ -82,8 +87,10 @@ extern NSString * const kRateAlertEventName; #pragma mark - MFMailComposeViewControllerDelegate - (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kRateAlertEventName, @"mailComposeController"]]; [self.alertController.ownerViewController dismissViewControllerAnimated:YES completion:^ { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kRateAlertEventName, @"close"]]; [self close]; }]; } diff --git a/iphone/Maps/Classes/CustomAlert/LocationAlert/MWMLocationAlert.mm b/iphone/Maps/Classes/CustomAlert/LocationAlert/MWMLocationAlert.mm index a0ce91498e..ab7cd7ce62 100644 --- a/iphone/Maps/Classes/CustomAlert/LocationAlert/MWMLocationAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/LocationAlert/MWMLocationAlert.mm @@ -8,13 +8,16 @@ #import "MWMLocationAlert.h" #import "MWMAlertViewController.h" +#import "Statistics.h" static NSString * const kLocationAlertNibName = @"MWMLocationAlert"; +static NSString * const kStatisticsEvent = @"Location Alert"; @implementation MWMLocationAlert + (instancetype)alert { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kStatisticsEvent, @"open"]]; MWMLocationAlert * alert = [[[NSBundle mainBundle] loadNibNamed:kLocationAlertNibName owner:nil options:nil] firstObject]; [alert setNeedsCloseAlertAfterEnterBackground]; return alert; @@ -22,12 +25,14 @@ static NSString * const kLocationAlertNibName = @"MWMLocationAlert"; - (IBAction)settingsTap { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kStatisticsEvent, @"settingsTap"]]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; [self close]; } - (IBAction)closeTap { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kStatisticsEvent, @"closeTap"]]; [self close]; } diff --git a/iphone/Maps/Classes/CustomAlert/PedestrianShareAlert/MWMPedestrianShareAlert.mm b/iphone/Maps/Classes/CustomAlert/PedestrianShareAlert/MWMPedestrianShareAlert.mm index fab5de5dbb..1768d19d95 100644 --- a/iphone/Maps/Classes/CustomAlert/PedestrianShareAlert/MWMPedestrianShareAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/PedestrianShareAlert/MWMPedestrianShareAlert.mm @@ -11,10 +11,10 @@ #import "MWMActivityViewController.h" #import "MWMAlertViewController.h" #import "MWMPedestrianShareAlert.h" -#import "UIColor+MapsMeColor.h" +#import "Statistics.h" #import "UIButton+RuntimeAttributes.h" +#import "UIColor+MapsMeColor.h" -#import "Statistics.h" #import "3party/Alohalytics/src/alohalytics_objc.h" static NSString * const kShareEventName = @"pedestrianShareEvent"; @@ -35,6 +35,7 @@ static NSString * const kShareEventName = @"pedestrianShareEvent"; + (MWMPedestrianShareAlert *)alert:(BOOL)isFirstLaunch { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kShareEventName, @"open"]]; MWMPedestrianShareAlert * view = [NSBundle.mainBundle loadNibNamed:NSStringFromClass(self.class) owner:self options:nil].firstObject; view.isFirstLaunch = isFirstLaunch; diff --git a/iphone/Maps/Classes/CustomAlert/RateAlert/MWMRateAlert.mm b/iphone/Maps/Classes/CustomAlert/RateAlert/MWMRateAlert.mm index 22410fd51a..c70ba70a8f 100644 --- a/iphone/Maps/Classes/CustomAlert/RateAlert/MWMRateAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/RateAlert/MWMRateAlert.mm @@ -6,9 +6,11 @@ // Copyright (c) 2015 MapsWithMe. All rights reserved. // -#import "MWMRateAlert.h" #import "MWMAlertViewController.h" +#import "MWMRateAlert.h" +#import "Statistics.h" #import "UIKitCategories.h" + #import "3party/Alohalytics/src/alohalytics_objc.h" extern NSString * const kUDAlreadyRatedKey; @@ -40,6 +42,7 @@ static NSString * const kRateAlertNibName = @"MWMRateAlert"; + (instancetype)alert { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kRateAlertEventName, @"open"]]; MWMRateAlert * alert = [[[NSBundle mainBundle] loadNibNamed:kRateAlertNibName owner:self options:nil] firstObject]; return alert; } @@ -48,6 +51,7 @@ static NSString * const kRateAlertNibName = @"MWMRateAlert"; - (IBAction)oneStarTap:(UILongPressGestureRecognizer *)sender { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kRateAlertEventName, @"oneStarTap"]]; [UIView animateWithDuration:0.15 animations:^ { self.oneStarPushImageView.alpha = 1.; @@ -68,6 +72,7 @@ static NSString * const kRateAlertNibName = @"MWMRateAlert"; - (IBAction)twoStarTap:(UILongPressGestureRecognizer *)sender { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kRateAlertEventName, @"twoStarTap"]]; [UIView animateWithDuration:0.15 animations:^ { self.twoStarPushImageView.alpha = 1.; @@ -89,6 +94,7 @@ static NSString * const kRateAlertNibName = @"MWMRateAlert"; - (IBAction)threeStarTap:(UILongPressGestureRecognizer *)sender { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kRateAlertEventName, @"threeStarTap"]]; [UIView animateWithDuration:0.15 animations:^ { self.threeStarPushImageView.alpha = 1.; @@ -111,6 +117,7 @@ static NSString * const kRateAlertNibName = @"MWMRateAlert"; - (IBAction)fourStarTap:(UILongPressGestureRecognizer *)sender { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kRateAlertEventName, @"fourStarTap"]]; [UIView animateWithDuration:0.15 animations:^ { self.fourStarPushImageView.alpha = 1.; @@ -134,6 +141,7 @@ static NSString * const kRateAlertNibName = @"MWMRateAlert"; - (IBAction)fiveStarTap:(UILongPressGestureRecognizer *)sender { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kRateAlertEventName, @"fiveStarTap"]]; [Alohalytics logEvent:kRateAlertEventName withValue:@"fiveStar"]; [UIView animateWithDuration:0.15 animations:^ { @@ -161,6 +169,7 @@ static NSString * const kRateAlertNibName = @"MWMRateAlert"; - (IBAction)notNowTap { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kRateAlertEventName, @"notNowTap"]]; [Alohalytics logEvent:kRateAlertEventName withValue:@"notNowTap"]; [self close]; } diff --git a/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.mm b/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.mm index e92c90a0a9..495a248496 100644 --- a/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.mm @@ -12,8 +12,10 @@ #import "UIColor+MapsMeColor.h" #import "UIFont+MapsMeFonts.h" #import "UIKitCategories.h" +#import "Statistics.h" static CGFloat const kMinimumOffset = 20.; +static NSString * const kStatisticsEvent = @"Routing Disclaimer Alert"; @interface MWMRoutingDisclaimerAlert () @@ -26,6 +28,7 @@ static CGFloat const kMinimumOffset = 20.; + (instancetype)alertWithInitialOrientation:(UIInterfaceOrientation)orientation { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kStatisticsEvent, @"open"]]; MWMRoutingDisclaimerAlert * alert = [[[NSBundle mainBundle] loadNibNamed:[MWMRoutingDisclaimerAlert className] owner:nil options:nil] firstObject]; @@ -50,6 +53,7 @@ static CGFloat const kMinimumOffset = 20.; - (IBAction)okTap { + [Statistics.instance logEvent:[NSString stringWithFormat:@"%@ - %@", kStatisticsEvent, @"okTap"]]; [self close]; } |