diff --git a/iphone/Maps/Classes/Common.h b/iphone/Maps/Classes/Common.h index 2925701bd4..0003a0820b 100644 --- a/iphone/Maps/Classes/Common.h +++ b/iphone/Maps/Classes/Common.h @@ -1,8 +1,6 @@ #import #import -static NSString * const FIRST_LAUNCH_KEY = @"FIRST_LAUNCH_KEY"; - static NSString * const MAPSWITHME_PREMIUM_LOCAL_URL = @"mapswithmepro://"; static NSString * const BOOKMARK_CATEGORY_DELETED_NOTIFICATION = @"BookmarkCategoryDeletedNotification"; diff --git a/iphone/Maps/Classes/LocalNotificationManager.mm b/iphone/Maps/Classes/LocalNotificationManager.mm index beea27673f..b510634a03 100644 --- a/iphone/Maps/Classes/LocalNotificationManager.mm +++ b/iphone/Maps/Classes/LocalNotificationManager.mm @@ -1,4 +1,3 @@ -#import "AppInfo.h" #import "Common.h" #import "Framework.h" #import "LocalNotificationInfoProvider.h" diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index 2b54b48095..a5d6c4869d 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -592,7 +592,7 @@ typedef NS_OPTIONS(NSUInteger, MapInfoView) if ((self = [super initWithCoder:coder])) { Framework & f = GetFramework(); - if ([[NSUserDefaults standardUserDefaults] boolForKey:FIRST_LAUNCH_KEY]) + if ([Alohalytics isFirstSession]) Settings::Set("ZoomButtonsEnabled", true); typedef void (*UserMarkActivatedFnT)(id, SEL, unique_ptr); diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index cfece62ba1..577441ee20 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -98,12 +98,6 @@ void InitLocalizedStrings() return (MapsAppDelegate *)[UIApplication sharedApplication].delegate; } -+ (BOOL)isFirstAppLaunch -{ - // TODO: check if possible when user reinstall the app - return [[NSUserDefaults standardUserDefaults] boolForKey:FIRST_LAUNCH_KEY]; -} - - (void)initMyTrackerService { NSString * const kMyTrackerAppId = @"***REMOVED***"; @@ -219,7 +213,7 @@ void InitLocalizedStrings() [notificationManager processNotification:launchOptions[UIApplicationLaunchOptionsLocalNotificationKey] onLaunch:YES]; [notificationManager updateLocalNotifications]; - if (self.class.isFirstAppLaunch) + if ([Alohalytics isFirstSession]) { [self firstLaunchSetup]; } diff --git a/iphone/Maps/main.mm b/iphone/Maps/main.mm index be3528d77b..071b710e6e 100644 --- a/iphone/Maps/main.mm +++ b/iphone/Maps/main.mm @@ -31,11 +31,6 @@ int main(int argc, char * argv[]) NSThread * thread = [[NSThread alloc] initWithTarget:dummy selector:@selector(dummyThread:) object:nil]; [thread start]; - // We use this work-around to avoid multiple calls for Settings::IsFirstLaunch() later with invalid results, - // as it returns true only once, on the very first call - [[NSUserDefaults standardUserDefaults] setBool:(Settings::IsFirstLaunch()) forKey:FIRST_LAUNCH_KEY]; - [[NSUserDefaults standardUserDefaults] synchronize]; - retVal = UIApplicationMain(argc, argv, nil, nil); } return retVal; diff --git a/platform/settings.cpp b/platform/settings.cpp index f85bfc9bda..646ee6af62 100644 --- a/platform/settings.cpp +++ b/platform/settings.cpp @@ -347,10 +347,4 @@ namespace Settings else return false; } - - bool IsFirstLaunch() - { - int unused; - return !Get(FIRST_LAUNCH_KEY, unused); - } } diff --git a/platform/settings.hpp b/platform/settings.hpp index 47dbb1a2f3..1918fcf879 100644 --- a/platform/settings.hpp +++ b/platform/settings.hpp @@ -53,8 +53,4 @@ namespace Settings /// Use this function for running some stuff once according to date. /// @param[in] date Current date in format yymmdd. bool IsFirstLaunchForDate(int date); - /// @Returns true when user launched app first time - /// Use to track new installs - /// @warning Can be used only before IsFirstLaunchForDate(int) call - bool IsFirstLaunch(); }