forked from organicmaps/organicmaps
[MAPSME-6511] [ios] Refactored Statistics class.
This commit is contained in:
parent
b66c324a28
commit
4726dee06b
6 changed files with 10 additions and 22 deletions
|
@ -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:
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
#import "Statistics.h"
|
||||
|
||||
#include "platform/platform.hpp"
|
||||
|
||||
@interface Statistics (ConnectionTypeLogging)
|
||||
|
||||
+ (NSString *)connectionTypeToString:(Platform::EConnectionType)type;
|
||||
|
||||
@end
|
|
@ -13,4 +13,6 @@
|
|||
+ (void)logEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters;
|
||||
+ (void)logEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters atLocation:(CLLocation *)location;
|
||||
|
||||
+ (NSString *)connectionTypeString;
|
||||
|
||||
@end
|
||||
|
|
|
@ -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 <MyTrackerSDK/MRMyTrackerParams.h>
|
||||
#import <FBSDKCoreKit/FBSDKCoreKit.h>
|
||||
|
||||
#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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue