From bdf8fd5b5d771ec9308528df66656f74b447a468 Mon Sep 17 00:00:00 2001 From: Kirill Zhdanovich Date: Mon, 28 Oct 2013 13:04:25 +0300 Subject: [PATCH] [iOS] Count conversion Guides->MWM, relying on "Units" variable in settings --- iphone/Maps/Settings/Preferences.mm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/iphone/Maps/Settings/Preferences.mm b/iphone/Maps/Settings/Preferences.mm index c23fddaf4c..3b64cd022e 100644 --- a/iphone/Maps/Settings/Preferences.mm +++ b/iphone/Maps/Settings/Preferences.mm @@ -2,6 +2,8 @@ #import #import #import "../Classes/MapViewController.h" +#import "Framework.h" +#import "Statistics.h" #include "../../platform/settings.hpp" @@ -53,6 +55,20 @@ [alert show]; [alert release]; } + + /*This code counts conversion Guides->MWM. We rely on setting with name "Units", and by the time this code will be executed, Framework->GuidesManager should be initialised*/ + set s; + GetFramework().GetGuidesManager().GetGuidesId(s); + NSMutableDictionary * guidesUrls = [[[NSMutableDictionary alloc] init] autorelease]; + for (set::iterator it = s.begin(); it != s.end();++it) + { + NSString * countryUrl = [NSString stringWithUTF8String:it->c_str()]; + if ([APP canOpenURL:[NSURL URLWithString:countryUrl]]) + guidesUrls[countryUrl] = @1; + } + if ([guidesUrls count]) + [[Statistics instance] logEvent:@"Guides Downloaded before MWM" withParameters:guidesUrls]; + Settings::Set("Units", u); } else