diff --git a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h index bde1e69c59..924c29b6d3 100644 --- a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h +++ b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h @@ -10,6 +10,7 @@ - (nonnull instancetype)initWithViewController:(nonnull UIViewController *)viewController; - (void)presentAlert:(routing::IRouter::ResultCode)type; +- (void)presentRoutingMigrationAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock; - (void)presentDownloaderAlertWithCountries:(storage::TCountriesVec const &)countries code:(routing::IRouter::ResultCode)code okBlock:(nonnull TMWMVoidBlock)okBlock; diff --git a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm index 4cd3bda69f..edc19e8831 100644 --- a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm +++ b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm @@ -111,6 +111,11 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController [self displayAlert:[MWMAlert invalidUserNameOrPasswordAlert]]; } +- (void)presentRoutingMigrationAlertWithOkBlock:(TMWMVoidBlock)okBlock +{ + [self displayAlert:[MWMAlert routingMigrationAlertWithOkBlock:okBlock]]; +} + - (void)presentDownloaderAlertWithCountries:(storage::TCountriesVec const &)countries code:(routing::IRouter::ResultCode)code okBlock:(TMWMVoidBlock)okBlock diff --git a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h index 7a699080b1..da46d7b85b 100644 --- a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h +++ b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h @@ -7,6 +7,7 @@ @property (weak, nonatomic) MWMAlertViewController * alertController; + (MWMAlert *)alert:(routing::IRouter::ResultCode)type; ++ (MWMAlert *)routingMigrationAlertWithOkBlock:(TMWMVoidBlock)okBlock; + (MWMAlert *)downloaderAlertWithAbsentCountries:(storage::TCountriesVec const &)countries code:(routing::IRouter::ResultCode)code okBlock:(TMWMVoidBlock)okBlock; diff --git a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm index a936623204..783a0e402c 100644 --- a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm @@ -62,6 +62,11 @@ return [MWMDefaultAlert locationServiceNotSupportedAlert]; } ++ (MWMAlert *)routingMigrationAlertWithOkBlock:(TMWMVoidBlock)okBlock +{ + return [MWMDefaultAlert routingMigrationAlertWithOkBlock:okBlock]; +} + + (MWMAlert *)downloaderAlertWithAbsentCountries:(storage::TCountriesVec const &)countries code:(routing::IRouter::ResultCode)code okBlock:(TMWMVoidBlock)okBlock diff --git a/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.h b/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.h index 89e458c0b9..7bcbb7ca33 100644 --- a/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.h +++ b/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.h @@ -23,5 +23,6 @@ + (instancetype)downloaderNotEnoughSpaceAlert; + (instancetype)downloaderInternalErrorAlertWithOkBlock:(TMWMVoidBlock)okBlock; + (instancetype)downloaderNeedUpdateAlertWithOkBlock:(TMWMVoidBlock)okBlock; ++ (instancetype)routingMigrationAlertWithOkBlock:(TMWMVoidBlock)okBlock; @end diff --git a/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.mm b/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.mm index be2130aea8..ff06f18466 100644 --- a/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.mm @@ -282,6 +282,17 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; return alert; } ++ (instancetype)routingMigrationAlertWithOkBlock:(TMWMVoidBlock)okBlock +{ + kStatisticsEvent = @"Routing Need Migration Alert"; + MWMDefaultAlert * alert = [self defaultAlertWithTitle:@"downloader_update_maps" + message:@"downloader_mwm_migration_dialog" + rightButtonTitle:@"ok" + leftButtonTitle:@"cancel" + rightButtonAction:okBlock]; + return alert; +} + + (instancetype)defaultAlertWithTitle:(nonnull NSString *)title message:(nullable NSString *)message rightButtonTitle:(nonnull NSString *)rightButtonTitle diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index c59bb5f1f7..bd474a8c60 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -614,21 +614,23 @@ NSString * const kReportSegue = @"Map2ReportSegue"; case routing::IRouter::FileTooOld: case routing::IRouter::RouteNotFound: { - [self presentDownloaderAlert:code countries:absentCountries okBlock:[=] + if (platform::migrate::NeedMigrate()) { - auto & s = GetFramework().Storage(); - for (auto const & countryId : absentCountries) - s.DownloadNode(countryId); - if (platform::migrate::NeedMigrate()) + [self presentRoutingMigrationAlertWithOkBlock:^ { - [Statistics logEvent:kStatDownloaderMigrationDialogue withParameters:@{kStatFrom : kStatMap}]; + [Statistics logEvent:kStatDownloaderMigrationDialogue withParameters:@{kStatFrom : kStatRouting}]; [self openMigration]; - } - else - { - [self openMapsDownloader]; - } - }]; + }]; + } + else + { + [self presentDownloaderAlert:code countries:absentCountries okBlock:^ + { + auto & s = GetFramework().Storage(); + for (auto const & countryId : absentCountries) + s.DownloadNode(countryId); + }]; + } break; } case routing::IRouter::Cancelled: @@ -762,6 +764,11 @@ NSString * const kReportSegue = @"Map2ReportSegue"; #pragma mark - ShowDialog callback +- (void)presentRoutingMigrationAlertWithOkBlock:(TMWMVoidBlock)okBlock +{ + [self.alertController presentRoutingMigrationAlertWithOkBlock:okBlock]; +} + - (void)presentDownloaderAlert:(routing::IRouter::ResultCode)code countries:(storage::TCountriesVec const &)countries okBlock:(TMWMVoidBlock)okBlock diff --git a/iphone/Maps/Statistics/StatisticsStrings.h b/iphone/Maps/Statistics/StatisticsStrings.h index 2787dac7cf..2249c74421 100644 --- a/iphone/Maps/Statistics/StatisticsStrings.h +++ b/iphone/Maps/Statistics/StatisticsStrings.h @@ -1,15 +1,15 @@ static NSString * const kStat3D = @"3D"; static NSString * const kStat3DBuildings= @"3D buildings"; +static NSString * const kStatAPI = @"API"; static NSString * const kStatAbout = @"About"; static NSString * const kStatAction = @"action"; static NSString * const kStatActionSheet = @"Action sheet"; static NSString * const kStatAd = @"Ad"; +static NSString * const kStatAdTitle = @"Ad title"; static NSString * const kStatAdd = @"Add"; static NSString * const kStatAddPlace = @"Add place"; -static NSString * const kStatAdTitle = @"Ad title"; static NSString * const kStatAlert = @"Alert"; static NSString * const kStatAllMaps = @"all_maps"; -static NSString * const kStatAPI = @"API"; static NSString * const kStatApplication = @"Application"; static NSString * const kStatApply = @"Apply"; static NSString * const kStatAuthorization = @"Authorization"; @@ -50,6 +50,10 @@ static NSString * const kStatDeviceInfo = @"Device info"; static NSString * const kStatDeviceType = @"Device type"; static NSString * const kStatDownload = @"download"; static NSString * const kStatDownloadGroup = @"download_group"; +static NSString * const kStatDownloadMap = @"Download map"; +static NSString * const kStatDownloadMaps = @"Download maps"; +static NSString * const kStatDownloadRequest = @"Download request"; +static NSString * const kStatDownloadRoute = @"Download route"; static NSString * const kStatDownloader = @"downloader"; static NSString * const kStatDownloaderDialog = @"Downloader dialog"; static NSString * const kStatDownloaderDownloadCancel = @"Downloader_Download_cancel"; @@ -59,10 +63,6 @@ static NSString * const kStatDownloaderMigrationCompleted = @"Downloader_Migrati static NSString * const kStatDownloaderMigrationDialogue = @"Downloader_Migration_dialogue"; static NSString * const kStatDownloaderMigrationError = @"Downloader_Migration_error"; static NSString * const kStatDownloaderMigrationStarted = @"Downloader_Migration_started"; -static NSString * const kStatDownloadMap = @"Download map"; -static NSString * const kStatDownloadMaps = @"Download maps"; -static NSString * const kStatDownloadRequest = @"Download request"; -static NSString * const kStatDownloadRoute = @"Download route"; static NSString * const kStatEdit = @"Edit"; static NSString * const kStatEditTime = @"Edit time"; static NSString * const kStatError = @"Error"; @@ -82,8 +82,8 @@ static NSString * const kStatHistory = @"History"; static NSString * const kStatImport = @"Import"; static NSString * const kStatIn = @"In"; static NSString * const kStatIsAuto = @"is_auto"; -static NSString * const kStatKilometers = @"Kilometers"; static NSString * const kStatKML = @"KML"; +static NSString * const kStatKilometers = @"Kilometers"; static NSString * const kStatLandscape = @"Landscape"; static NSString * const kStatLanguage = @"Language"; static NSString * const kStatLocation = @"Location"; @@ -105,13 +105,13 @@ static NSString * const kStatNightMode = @"NightMode"; static NSString * const kStatNo = @"No"; static NSString * const kStatNoConnection = @"no_connection"; static NSString * const kStatNoSpace = @"no_space"; +static NSString * const kStatOSM = @"OSM"; static NSString * const kStatOff = @"Off"; static NSString * const kStatOn = @"On"; static NSString * const kStatOpen = @"Open"; static NSString * const kStatOpenActionSheet = @"Open action sheet"; static NSString * const kStatOpenSite = @"Open site"; static NSString * const kStatOrientation = @"Orientation"; -static NSString * const kStatOSM = @"OSM"; static NSString * const kStatOther = @"Other"; static NSString * const kStatOut = @"Out"; static NSString * const kStatPedestrian = @"Pedestrian"; @@ -120,8 +120,6 @@ static NSString * const kStatPointToPoint = @"Point to point"; static NSString * const kStatPortrait = @"Portrait"; static NSString * const kStatProgress = @"Progress"; static NSString * const kStatPushReceived = @"Push received"; -static NSString * const kStatiPad = @"iPad"; -static NSString * const kStatiPhone = @"iPhone"; static NSString * const kStatRate = @"Rate"; static NSString * const kStatRecentTrack = @"Recent track"; static NSString * const kStatRegular = @"Regular"; @@ -129,6 +127,7 @@ static NSString * const kStatRemove = @"Remove"; static NSString * const kStatRename = @"Rename"; static NSString * const kStatReport = @"Report"; static NSString * const kStatRetry = @"retry"; +static NSString * const kStatRouting = @"routing"; static NSString * const kStatSave = @"Save"; static NSString * const kStatScenario = @"scenario"; static NSString * const kStatScreen = @"Screen"; @@ -148,7 +147,10 @@ static NSString * const kStatSocial = @"Social"; static NSString * const kStatSource = @"Source"; static NSString * const kStatStart = @"Start"; static NSString * const kStatSwapRoutingPoints = @"Swap routing points"; +static NSString * const kStatTTS = @"TTS"; +static NSString * const kStatTTSSettings = @"TTS settings"; static NSString * const kStatTable = @"Table"; +static NSString * const kStatToMyPosition = @"To my position"; static NSString * const kStatToggleBookmark = @"Toggle bookmark"; static NSString * const kStatToggleCompassCalibration = @"Toggle compass calibration"; static NSString * const kStatToggleCoordinates = @"Toggle coordinates"; @@ -157,9 +159,6 @@ static NSString * const kStatToggleSection = @"Toggle section"; static NSString * const kStatToggleStatistics = @"Toggle statistics"; static NSString * const kStatToggleVisibility = @"Toggle visibility"; static NSString * const kStatToggleZoomButtonsVisibility = @"Toggle zoom buttons visibility"; -static NSString * const kStatToMyPosition = @"To my position"; -static NSString * const kStatTTS = @"TTS"; -static NSString * const kStatTTSSettings = @"TTS settings"; static NSString * const kStatType = @"type"; static NSString * const kStatUnknownError = @"unknown_error"; static NSString * const kStatUpdate = @"update"; @@ -170,6 +169,8 @@ static NSString * const kStatVisible = @"Visible"; static NSString * const kStatWhatsNew = @"What's New"; static NSString * const kStatYes = @"Yes"; static NSString * const kStatZoom = @"Zoom"; +static NSString * const kStatiPad = @"iPad"; +static NSString * const kStatiPhone = @"iPhone"; static inline NSString * const kStatEventName(NSString * component, NSString * action) {