diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index 5ff6a0f152..0a8a677d44 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -17,7 +17,6 @@ #import "MWMTextToSpeech.h" #import "MapViewController.h" #import "Statistics.h" -#import "Statistics+ConnectionTypeLogging.h" #import "SwiftBridge.h" #include "Framework.h" @@ -590,9 +589,8 @@ using namespace osm_auth_ios; [statistics application:application didFinishLaunchingWithOptions:launchOptions]; NSString * connectionType; - auto const status = Platform::ConnectionStatus(); - NSString * network = [Statistics connectionTypeToString:status]; - switch (status) + NSString * network = [Statistics connectionTypeString]; + switch (Platform::ConnectionStatus()) { case Platform::EConnectionType::CONNECTION_NONE: break; case Platform::EConnectionType::CONNECTION_WIFI: diff --git a/iphone/Maps/Common/Statistics/Statistics+ConnectionTypeLogging.h b/iphone/Maps/Common/Statistics/Statistics+ConnectionTypeLogging.h deleted file mode 100644 index 2fe0bf008c..0000000000 --- a/iphone/Maps/Common/Statistics/Statistics+ConnectionTypeLogging.h +++ /dev/null @@ -1,9 +0,0 @@ -#import "Statistics.h" - -#include "platform/platform.hpp" - -@interface Statistics (ConnectionTypeLogging) - -+ (NSString *)connectionTypeToString:(Platform::EConnectionType)type; - -@end diff --git a/iphone/Maps/Common/Statistics/Statistics.h b/iphone/Maps/Common/Statistics/Statistics.h index 8048d472ff..3bec2d8708 100644 --- a/iphone/Maps/Common/Statistics/Statistics.h +++ b/iphone/Maps/Common/Statistics/Statistics.h @@ -13,4 +13,6 @@ + (void)logEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters; + (void)logEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters atLocation:(CLLocation *)location; ++ (NSString *)connectionTypeString; + @end diff --git a/iphone/Maps/Common/Statistics/Statistics.mm b/iphone/Maps/Common/Statistics/Statistics.mm index eabb716a5d..773a05d586 100644 --- a/iphone/Maps/Common/Statistics/Statistics.mm +++ b/iphone/Maps/Common/Statistics/Statistics.mm @@ -1,5 +1,4 @@ #import "Statistics.h" -#import "Statistics+ConnectionTypeLogging.h" #import "AppInfo.h" #import "MWMCustomFacebookEvents.h" #import "MWMSettings.h" @@ -10,6 +9,7 @@ #import #import +#include "platform/platform.hpp" #include "platform/settings.hpp" #include "base/macros.hpp" @@ -143,9 +143,9 @@ void checkFlurryLogStatus(FlurryEventRecordStatus status) @implementation Statistics (ConnectionTypeLogging) -+ (NSString *)connectionTypeToString:(Platform::EConnectionType)type ++ (NSString *)connectionTypeString { - switch (type) + switch (Platform::ConnectionStatus()) { case Platform::EConnectionType::CONNECTION_WWAN: return kStatOffline; diff --git a/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm b/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm index ef1b58d4a7..ae1dd74da1 100644 --- a/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm +++ b/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm @@ -11,7 +11,6 @@ #import "MapViewController.h" #import "MapsAppDelegate.h" #import "Statistics.h" -#import "Statistics+ConnectionTypeLogging.h" #import "SwiftBridge.h" #include "Framework.h" @@ -293,9 +292,8 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) { - (IBAction)discoveryTap { - auto const connectionType = GetPlatform().ConnectionStatus(); [Statistics logEvent:kStatDiscoveryButtonOpen - withParameters:@{kStatNetwork: [Statistics connectionTypeToString:connectionType]}]; + withParameters:@{kStatNetwork: [Statistics connectionTypeString]}]; self.state = self.restoreState; diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm index 86ffee6063..c1d2c50b61 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm @@ -15,7 +15,6 @@ #import "MWMUGCViewModel.h" #import "MapViewController.h" #import "Statistics.h" -#import "Statistics+ConnectionTypeLogging.h" #import "SwiftBridge.h" #include "Framework.h" @@ -252,8 +251,8 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName) parameters[kStatProvider] = data.partnerName; else if (data.isHolidayObject) parameters[kStatProvider] = kStatHoliday; - - parameters[kStatConnection] = [Statistics connectionTypeToString:Platform::ConnectionStatus()]; + + parameters[kStatConnection] = [Statistics connectionTypeString]; parameters[kStatTags] = data.statisticsTags; [Statistics logEvent:kStatPlacepageSponsoredOpen withParameters:parameters]; }