From 43c1e805d04fc534d723f86324cf8bd4124d1c3d Mon Sep 17 00:00:00 2001 From: VladiMihaylenko Date: Wed, 13 Dec 2017 18:36:04 +0300 Subject: [PATCH] [ios] Release fixes. --- .../Common/Statistics/StatisticsStrings.h | 9 +++- iphone/Maps/Maps.xcodeproj/project.pbxproj | 8 --- .../BottomMenu/MWMBottomMenuViewController.mm | 2 +- .../DiscoveryCollectionHolderCell.xib | 51 ------------------- ...scoveryLocalExpertCollectionHolderCell.xib | 6 +++ .../DiscoveryOnlineTemplateCell.swift | 7 +-- .../DiscoverySearchCollectionHolderCell.xib | 6 +++ .../DiscoveryViatorCollectionHolderCell.xib | 6 +++ .../UI/Discovery/MWMDiscoveryController.mm | 36 +++++++++---- .../UI/Discovery/MWMDiscoveryTableManager.h | 3 +- .../UI/Discovery/MWMDiscoveryTableManager.mm | 31 +++++++---- .../UI/Discovery/MWMDiscoveryTapDelegate.h | 1 + .../Content/Cian/PPCianCarouselCell.swift | 8 ++- .../ViatorCells/PPViatorCarouselCell.swift | 3 +- .../PlacePageLayout/MWMPlacePageLayout.mm | 5 +- 15 files changed, 88 insertions(+), 94 deletions(-) delete mode 100644 iphone/Maps/UI/Discovery/DiscoveryCollectionHolderCell.xib diff --git a/iphone/Maps/Common/Statistics/StatisticsStrings.h b/iphone/Maps/Common/Statistics/StatisticsStrings.h index eaebf8fb93..6f932ddc21 100644 --- a/iphone/Maps/Common/Statistics/StatisticsStrings.h +++ b/iphone/Maps/Common/Statistics/StatisticsStrings.h @@ -77,6 +77,7 @@ static NSString * const kStatDeleteWithChanges = @"delete_with_changes"; static NSString * const kStatDestination = @"Destination"; static NSString * const kStatDeviceInfo = @"Device info"; static NSString * const kStatDeviceType = @"Device type"; +static NSString * const kStatDiscovery = @"discovery"; static NSString * const kStatDiscoveryButtonItemClick = @"DiscoveryButton_Item_Click"; static NSString * const kStatDiscoveryButtonItemShow = @"DiscoveryButton_Item_Show"; static NSString * const kStatDiscoveryButtonOpen = @"DiscoveryButton_Open"; @@ -131,6 +132,7 @@ static NSString * const kStatExpandCategory = @"Expand category"; static NSString * const kStatExpandLargeCountry = @"Expand large country"; static NSString * const kStatExplore = @"Explore"; static NSString * const kStatExport = @"Export"; +static NSString * const kStatExternal = @"external"; static NSString * const kStatFacebook = @"Facebook"; static NSString * const kStatFeedback = @"Feedback"; static NSString * const kStatFrom = @"from"; @@ -152,12 +154,13 @@ static NSString * const kStatIsAuthenticated = @"is_authenticated"; static NSString * const kStatIsAuto = @"is_auto"; static NSString * const kStatIsOnline = @"is_online"; static NSString * const kStatIsSuccess = @"is_success"; +static NSString * const kStatItem = @"item"; static NSString * const kStatKML = @"KML"; static NSString * const kStatKilometers = @"Kilometers"; static NSString * const kStatLandscape = @"Landscape"; static NSString * const kStatLanguage = @"Language"; static NSString * const kStatLocals = @"Locals"; -static NSString * const kStatLocalsProvider = @"locals.maps.me"; +static NSString * const kStatLocalsProvider = @"Locals.Maps.Me"; static NSString * const kStatLocation = @"Location"; static NSString * const kStatLogout = @"Logout"; static NSString * const kStatMap = @"map"; @@ -194,6 +197,7 @@ static NSString * const kStatObjectLon = @"object_lon"; static NSString * const kStatOff = @"Off"; static NSString * const kStatOffline = @"offline"; static NSString * const kStatOn = @"On"; +static NSString * const kStatOnline = @"online"; static NSString * const kStatOpen = @"Open"; static NSString * const kStatOpenActionSheet = @"Open action sheet"; static NSString * const kStatOpenSite = @"Open site"; @@ -202,6 +206,7 @@ static NSString * const kStatOrientation = @"Orientation"; static NSString * const kStatOther = @"Other"; static NSString * const kStatOut = @"Out"; static NSString * const kStatPedestrian = @"Pedestrian"; +static NSString * const kStatPlacement = @"placement"; static NSString * const kStatPlacePage = @"placepage"; static NSString * const kStatPlacePageBannerBlank = @"Placepage_Banner_blank"; static NSString * const kStatPlacePageBannerClick = @"Placepage_Banner_click"; @@ -278,12 +283,14 @@ static NSString * const kStatSave = @"Save"; static NSString * const kStatScenario = @"scenario"; static NSString * const kStatScreen = @"Screen"; static NSString * const kStatSearch = @"search"; +static NSString * const kStatSearchAttractions = @"Search.Attractions"; static NSString * const kStatSearchEnteredState = @"Search entered state"; static NSString * const kStatSearchFilterApply = @"Search_Filter_Apply"; static NSString * const kStatSearchFilterCancel = @"Search_Filter_Cancel"; static NSString * const kStatSearchFilterClick = @"Search_Filter_Click"; static NSString * const kStatSearchFilterOpen = @"Search_Filter_Open"; static NSString * const kStatSearchFilterReset = @"Search_Filter_Reset"; +static NSString * const kStatSearchRestaurants = @"Search.Restaurants"; static NSString * const kStatSearchSponsoredSelect = @"Search_SponsoredCategory_selected"; static NSString * const kStatSearchSponsoredShow = @"Search_SponsoredCategory_shown"; static NSString * const kStatSelectMap = @"Select map"; diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 246e9a0114..9fa92fa379 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -1229,9 +1229,6 @@ F607C1891C032A8800B53A87 /* resources-hdpi_dark in Resources */ = {isa = PBXBuildFile; fileRef = F607C1841C032A8800B53A87 /* resources-hdpi_dark */; }; F607C18A1C032A8800B53A87 /* resources-hdpi_dark in Resources */ = {isa = PBXBuildFile; fileRef = F607C1841C032A8800B53A87 /* resources-hdpi_dark */; }; F607C18E1C047FDC00B53A87 /* MWMSegue.mm in Sources */ = {isa = PBXBuildFile; fileRef = F607C18D1C047FDC00B53A87 /* MWMSegue.mm */; }; - F60C8BEA1FCD751F00DCF5FB /* DiscoveryCollectionHolderCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F60C8BE91FCD751F00DCF5FB /* DiscoveryCollectionHolderCell.xib */; }; - F60C8BEB1FCD751F00DCF5FB /* DiscoveryCollectionHolderCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F60C8BE91FCD751F00DCF5FB /* DiscoveryCollectionHolderCell.xib */; }; - F60C8BEC1FCD751F00DCF5FB /* DiscoveryCollectionHolderCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F60C8BE91FCD751F00DCF5FB /* DiscoveryCollectionHolderCell.xib */; }; F60C8BEE1FCED15900DCF5FB /* DiscoverySearchCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F60C8BED1FCED15900DCF5FB /* DiscoverySearchCell.xib */; }; F60C8BEF1FCED15A00DCF5FB /* DiscoverySearchCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F60C8BED1FCED15900DCF5FB /* DiscoverySearchCell.xib */; }; F60C8BF01FCED15A00DCF5FB /* DiscoverySearchCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F60C8BED1FCED15900DCF5FB /* DiscoverySearchCell.xib */; }; @@ -2577,7 +2574,6 @@ F607C1841C032A8800B53A87 /* resources-hdpi_dark */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "resources-hdpi_dark"; path = "../../data/resources-hdpi_dark"; sourceTree = ""; }; F607C18C1C047FDC00B53A87 /* MWMSegue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSegue.h; sourceTree = ""; }; F607C18D1C047FDC00B53A87 /* MWMSegue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSegue.mm; sourceTree = ""; }; - F60C8BE91FCD751F00DCF5FB /* DiscoveryCollectionHolderCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DiscoveryCollectionHolderCell.xib; sourceTree = ""; }; F60C8BED1FCED15900DCF5FB /* DiscoverySearchCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DiscoverySearchCell.xib; sourceTree = ""; }; F61579321AC2CE9A0032D8E9 /* MWMRateAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMRateAlert.h; sourceTree = ""; }; F61579331AC2CE9A0032D8E9 /* MWMRateAlert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMRateAlert.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; @@ -5036,7 +5032,6 @@ F69739DA1FD6ECCE00FDA07D /* DiscoveryLocalExpertCell.swift */, F69739DE1FD6EE1D00FDA07D /* DiscoveryLocalExpertCell.xib */, F5BD2A86D9DA2F9769D30B54 /* DiscoveryCollectionHolderCell.swift */, - F60C8BE91FCD751F00DCF5FB /* DiscoveryCollectionHolderCell.xib */, F6A806511FDAE51600D4D26F /* DiscoveryViatorCollectionHolderCell.xib */, F603E0581FDE9410006B84D6 /* DiscoveryLocalExpertCollectionHolderCell.xib */, F603E05C1FDE9703006B84D6 /* DiscoverySearchCollectionHolderCell.xib */, @@ -5455,7 +5450,6 @@ F6E2FE931E097BA00083EBEC /* PlacePageTaxiCell.xib in Resources */, F6E2FEA51E097BA00083EBEC /* MWMPPView.xib in Resources */, F69CE8D91E5C5088002B5881 /* PPHotelCarouselCell.xib in Resources */, - F60C8BEA1FCD751F00DCF5FB /* DiscoveryCollectionHolderCell.xib in Resources */, F61579361AC2CEB60032D8E9 /* MWMRateAlert.xib in Resources */, F63774E71B59375E00BCF54D /* MWMRoutingDisclaimerAlert.xib in Resources */, F6E2FEFF1E097BA00083EBEC /* MWMSearchCategoryCell.xib in Resources */, @@ -5658,7 +5652,6 @@ F6E2FEA61E097BA00083EBEC /* MWMPPView.xib in Resources */, 6741A9811BF340DE002C974C /* MWMRateAlert.xib in Resources */, 6741A9601BF340DE002C974C /* MWMRoutingDisclaimerAlert.xib in Resources */, - F60C8BEB1FCD751F00DCF5FB /* DiscoveryCollectionHolderCell.xib in Resources */, F6E2FF001E097BA00083EBEC /* MWMSearchCategoryCell.xib in Resources */, F6E2FF331E097BA00083EBEC /* MWMSearchCommonCell.xib in Resources */, F6E2FF061E097BA00083EBEC /* MWMSearchHistoryClearCell.xib in Resources */, @@ -5865,7 +5858,6 @@ 849CF6191DE842290024A8A5 /* MWMRoutingDisclaimerAlert.xib in Resources */, F6E2FF011E097BA00083EBEC /* MWMSearchCategoryCell.xib in Resources */, F6E2FF341E097BA00083EBEC /* MWMSearchCommonCell.xib in Resources */, - F60C8BEC1FCD751F00DCF5FB /* DiscoveryCollectionHolderCell.xib in Resources */, 3488B0171E9D0AEC0068AFD8 /* AdBanner.xib in Resources */, F6E2FF071E097BA00083EBEC /* MWMSearchHistoryClearCell.xib in Resources */, BB7626B71E85599C0031D71C /* icudt57l.dat in Resources */, diff --git a/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm b/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm index f721050e18..8d484a3cf9 100644 --- a/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm +++ b/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm @@ -298,7 +298,7 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) { auto const connectionType = GetPlatform().ConnectionStatus(); [Statistics logEvent:kStatDiscoveryButtonOpen - withParameters:@{kStatConnection : [Statistics connectionTypeToString:connectionType]}]; + withParameters:@{kStatNetwork: [Statistics connectionTypeToString:connectionType]}]; auto discovery = [MWMDiscoveryController instance]; using namespace network_policy; diff --git a/iphone/Maps/UI/Discovery/DiscoveryCollectionHolderCell.xib b/iphone/Maps/UI/Discovery/DiscoveryCollectionHolderCell.xib deleted file mode 100644 index a0023159ed..0000000000 --- a/iphone/Maps/UI/Discovery/DiscoveryCollectionHolderCell.xib +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iphone/Maps/UI/Discovery/DiscoveryLocalExpertCollectionHolderCell.xib b/iphone/Maps/UI/Discovery/DiscoveryLocalExpertCollectionHolderCell.xib index 373150b3af..f56c5e7be9 100644 --- a/iphone/Maps/UI/Discovery/DiscoveryLocalExpertCollectionHolderCell.xib +++ b/iphone/Maps/UI/Discovery/DiscoveryLocalExpertCollectionHolderCell.xib @@ -53,8 +53,14 @@ + + + + + + diff --git a/iphone/Maps/UI/Discovery/DiscoveryOnlineTemplateCell.swift b/iphone/Maps/UI/Discovery/DiscoveryOnlineTemplateCell.swift index 4f73e20f4c..56d4982d88 100644 --- a/iphone/Maps/UI/Discovery/DiscoveryOnlineTemplateCell.swift +++ b/iphone/Maps/UI/Discovery/DiscoveryOnlineTemplateCell.swift @@ -25,17 +25,14 @@ final class DiscoveryOnlineTemplateCell: MWMTableViewCell { typealias Tap = () -> () private var tap: Tap? - private var type: DiscoveryOnlineTemplateType = .viator - @objc func config(type: DiscoveryOnlineTemplateType, needSpinner: Bool, tap: @escaping Tap) { - self.type = type; - switch type { case .viator: title.text = L("preloader_viator_title") subtitle.text = L("preloader_viator_message") case .locals: - title.text = L("discovery_button_other_error_message") + title.text = needSpinner ? L("discovery_button_other_loading_message") : + L("discovery_button_other_error_message") subtitle.text = "" } diff --git a/iphone/Maps/UI/Discovery/DiscoverySearchCollectionHolderCell.xib b/iphone/Maps/UI/Discovery/DiscoverySearchCollectionHolderCell.xib index 1cae760b0c..36088cc2ed 100644 --- a/iphone/Maps/UI/Discovery/DiscoverySearchCollectionHolderCell.xib +++ b/iphone/Maps/UI/Discovery/DiscoverySearchCollectionHolderCell.xib @@ -53,8 +53,14 @@ + + + + + + diff --git a/iphone/Maps/UI/Discovery/DiscoveryViatorCollectionHolderCell.xib b/iphone/Maps/UI/Discovery/DiscoveryViatorCollectionHolderCell.xib index ff16368631..62a05c5e04 100644 --- a/iphone/Maps/UI/Discovery/DiscoveryViatorCollectionHolderCell.xib +++ b/iphone/Maps/UI/Discovery/DiscoveryViatorCollectionHolderCell.xib @@ -66,8 +66,14 @@ + + + + + + diff --git a/iphone/Maps/UI/Discovery/MWMDiscoveryController.mm b/iphone/Maps/UI/Discovery/MWMDiscoveryController.mm index 15db9f50e6..26eefe35c3 100644 --- a/iphone/Maps/UI/Discovery/MWMDiscoveryController.mm +++ b/iphone/Maps/UI/Discovery/MWMDiscoveryController.mm @@ -136,6 +136,7 @@ struct Callback - (void)tapOnItem:(ItemType const)type atIndex:(size_t const)index { + NSString * dest = @""; switch (type) { case ItemType::Viator: @@ -144,6 +145,7 @@ struct Callback auto const & url = type == ItemType::Viator ? m_model.GetViatorAt(index).m_pageUrl : m_model.GetExpertAt(index).m_pageUrl; [self openUrl:[NSURL URLWithString:@(url.c_str())]]; + dest = kStatExternal; break; } case ItemType::Attractions: @@ -153,6 +155,7 @@ struct Callback type == ItemType::Attractions ? m_model.GetAttractionAt(index) : m_model.GetCafeAt(index); GetFramework().ShowSearchResult(item); [self.navigationController popViewControllerAnimated:YES]; + dest = kStatPlacePage; break; } case ItemType::Hotels: @@ -162,12 +165,14 @@ struct Callback } } - auto const categoryAndProvider = StatCategoryAndProvider(type); + NSAssert(dest.length > 0, @""); [Statistics logEvent:kStatDiscoveryButtonItemClick - withParameters:@{kStatCategory : categoryAndProvider.first, - kStatProvider : categoryAndProvider.second, - kStatDestination : kStatPlacePage, - kStatPosition : @(index + 1)}]; + withParameters:@{ + kStatProvider: StatProvider(type), + kStatPlacement: kStatDiscovery, + kStatItem: @(index + 1), + kStatDestination: dest + }]; } - (void)routeToItem:(ItemType const)type atIndex:(size_t const)index @@ -185,12 +190,13 @@ struct Callback [MWMRouter buildToPoint:pt bestRouter:NO]; [self.navigationController popViewControllerAnimated:YES]; - auto const categoryAndProvider = StatCategoryAndProvider(type); [Statistics logEvent:kStatDiscoveryButtonItemClick - withParameters:@{kStatCategory : categoryAndProvider.first, - kStatProvider : categoryAndProvider.second, - kStatDestination : kStatRouting, - kStatPosition : @(index + 1)}]; + withParameters:@{ + kStatProvider: StatProvider(type), + kStatPlacement: kStatDiscovery, + kStatItem: @(index + 1), + kStatDestination: kStatRouting + }]; } - (void)openURLForItem:(discovery::ItemType const)type @@ -200,7 +206,17 @@ struct Callback auto & f = GetFramework(); auto const url = type == ItemType::Viator ? f.GetDiscoveryViatorUrl() : f.GetDiscoveryLocalExpertsUrl(); + [self openUrl:[NSURL URLWithString:@(url.c_str())]]; } +- (void)tapOnLogo:(discovery::ItemType const)type +{ + CHECK(type == ItemType::Viator, + ("Attempt to open url for item with type:", static_cast(type))); + [Statistics logEvent:kStatPlacepageSponsoredLogoSelected + withParameters:@{kStatProvider: StatProvider(type), kStatPlacement: kStatDiscovery}]; + [self openURLForItem:type]; +} + @end diff --git a/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.h b/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.h index 11c24a13df..72d3128bc6 100644 --- a/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.h +++ b/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.h @@ -1,14 +1,13 @@ #include "map/discovery/discovery_client_params.hpp" #include -#include #include namespace discovery { class DiscoveryControllerViewModel; -std::pair StatCategoryAndProvider(ItemType const type); +NSString * StatProvider(ItemType const type); } // namespace discovery using GetModelCallback = std::function; diff --git a/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm b/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm index eb603d0df9..bc15c09bcd 100644 --- a/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm +++ b/iphone/Maps/UI/Discovery/MWMDiscoveryTableManager.mm @@ -29,15 +29,15 @@ using namespace std; namespace discovery { -pair StatCategoryAndProvider(ItemType const type) +NSString * StatProvider(ItemType const type) { switch (type) { - case ItemType::Viator: return {kStatThingsToDo, kStatViator}; - case ItemType::LocalExperts: return {kStatLocals, kStatLocalsProvider}; - case ItemType::Attractions: return {kStatAttractions, kStatSearch}; - case ItemType::Cafes: return {kStatEatAndDrink, kStatSearch}; - case ItemType::Hotels: ASSERT(false, ()); return {}; + case ItemType::Viator: return kStatViator; + case ItemType::LocalExperts: return kStatLocalsProvider; + case ItemType::Attractions: return kStatSearchAttractions; + case ItemType::Cafes: return kStatSearchRestaurants; + case ItemType::Hotels: ASSERT(false, ()); return @""; } } } // namespace discovery @@ -115,6 +115,7 @@ string GetDistance(m2::PointD const & from, m2::PointD const & to) [self removeItem:type]; return; } + m_loadingTypes.erase(remove(m_loadingTypes.begin(), m_loadingTypes.end(), type), m_loadingTypes.end()); m_failedTypes.erase(remove(m_failedTypes.begin(), m_failedTypes.end(), type), @@ -123,10 +124,12 @@ string GetDistance(m2::PointD const & from, m2::PointD const & to) [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:0 inSection:position]] withRowAnimation:kDefaultRowAnimation]; - auto const categoryAndProvider = StatCategoryAndProvider(type); - [Statistics logEvent:kStatDiscoveryButtonItemShow - withParameters:@{kStatCategory : categoryAndProvider.first, - kStatProvider : categoryAndProvider.second}]; + [Statistics logEvent:kStatPlacepageSponsoredShow + withParameters:@{ + kStatProvider: StatProvider(type), + kStatPlacement: kStatDiscovery, + kStatState: self.isOnline ? kStatOnline : kStatOffline + }]; } - (void)errorAtItem:(ItemType const)type @@ -137,12 +140,18 @@ string GetDistance(m2::PointD const & from, m2::PointD const & to) m_loadingTypes.end()); m_failedTypes.push_back(type); auto const position = [self position:type]; + + [Statistics logEvent:kStatPlacepageSponsoredError + withParameters:@{kStatProvider: StatProvider(type), kStatPlacement: kStatDiscovery}]; + [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:position] withRowAnimation:kDefaultRowAnimation]; } #pragma mark - Private +- (BOOL)isOnline { return find(m_types.begin(), m_types.end(), ItemType::Viator) != m_types.end(); } + - (void)removeItem:(ItemType const)type { auto const position = [self position:type]; @@ -206,7 +215,7 @@ string GetDistance(m2::PointD const & from, m2::PointD const & to) [self.tableView dequeueReusableCellWithCellClass:cls indexPath:indexPath]); auto collection = static_cast(cell.collectionView); [cell configWithTap:^{ - [self.delegate openURLForItem:ItemType::Viator]; + [self.delegate tapOnLogo:ItemType::Viator]; }]; collection.delegate = self; diff --git a/iphone/Maps/UI/Discovery/MWMDiscoveryTapDelegate.h b/iphone/Maps/UI/Discovery/MWMDiscoveryTapDelegate.h index 422738d02b..399e43cabe 100644 --- a/iphone/Maps/UI/Discovery/MWMDiscoveryTapDelegate.h +++ b/iphone/Maps/UI/Discovery/MWMDiscoveryTapDelegate.h @@ -5,5 +5,6 @@ - (void)tapOnItem:(discovery::ItemType const)type atIndex:(size_t const)index; - (void)routeToItem:(discovery::ItemType const)type atIndex:(size_t const)index; - (void)openURLForItem:(discovery::ItemType const)type; +- (void)tapOnLogo:(discovery::ItemType const)type; @end diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Cian/PPCianCarouselCell.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Cian/PPCianCarouselCell.swift index 59f3cffd5e..95405aeca7 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Cian/PPCianCarouselCell.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Cian/PPCianCarouselCell.swift @@ -30,7 +30,8 @@ final class PPCianCarouselCell: MWMTableViewCell { fileprivate let kMaximumNumberOfElements = 5 fileprivate var delegate: MWMPlacePageButtonsProtocol? - fileprivate var statisticsParameters: [AnyHashable: Any] { return [kStatProvider: kStatCian] } + fileprivate var statisticsParameters: [AnyHashable: Any] { return [kStatProvider: kStatCian, + kStatPlacement : kStatPlacePage] } @objc func config(delegate d: MWMPlacePageButtonsProtocol?) { delegate = d @@ -92,13 +93,16 @@ extension PPCianCarouselCell: UICollectionViewDelegate, UICollectionViewDataSour }) } else { let model = isLastCell(indexPath) ? nil : data[indexPath.item] + var params = statisticsParameters + params[kStatItem] = indexPath.row + 1 + params[kStatDestination] = kStatExternal cell.state = .offer(model: model, onButtonAction: { [unowned self] model in let isMore = model == nil MRMyTracker.trackEvent(withName: isMore ? "Placepage_SponsoredGallery_MoreItem_selected_Cian.Ru" : "Placepage_SponsoredGallery_ProductItem_selected_Cian.Ru") Statistics.logEvent(isMore ? kStatPlacepageSponsoredMoreSelected : kStatPlacepageSponsoredItemSelected, - withParameters: self.statisticsParameters) + withParameters: params) self.delegate?.openSponsoredURL(model?.pageURL) }) } diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/ViatorCells/PPViatorCarouselCell.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/ViatorCells/PPViatorCarouselCell.swift index 707e9591f2..8b1e8237ea 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/ViatorCells/PPViatorCarouselCell.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/ViatorCells/PPViatorCarouselCell.swift @@ -21,7 +21,8 @@ final class PPViatorCarouselCell: MWMTableViewCell { fileprivate let kMaximumNumberOfElements = 5 fileprivate var delegate: MWMPlacePageButtonsProtocol? - fileprivate var statisticsParameters: [AnyHashable: Any] { return [kStatProvider: kStatViator] } + fileprivate var statisticsParameters: [AnyHashable: Any] { return [kStatProvider: kStatViator, + kStatPlacement : kStatPlacePage] } @objc func config(with ds: [ViatorItemModel], delegate d: MWMPlacePageButtonsProtocol?) { if ds.isEmpty { diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm index 1049634f6e..e0f1783922 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm @@ -608,7 +608,7 @@ map const kMetaInfoCells = { case taxi::Provider::Uber: provider = kStatUber; break; case taxi::Provider::Yandex: provider = kStatYandex; break; } - [Statistics logEvent:kStatPlacepageTaxiShow withParameters:@{ @"provider" : provider }]; + [Statistics logEvent:kStatPlacepageTaxiShow withParameters:@{kStatProvider : provider}]; }); checkCell(self.viatorCell, ^{ @@ -626,7 +626,8 @@ map const kMetaInfoCells = { checkCell(self.cianCell, ^{ self.cianCell = nil; [MRMyTracker trackEventWithName:@"Placepage_SponsoredGallery_shown_Cian.Ru"]; - [Statistics logEvent:kStatPlacepageSponsoredShow withParameters:@{kStatProvider : kStatCian}]; + [Statistics logEvent:kStatPlacepageSponsoredShow + withParameters:@{kStatProvider : kStatCian, kStatPlacement: kStatPlacePage}]; }); }