Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/iphone
diff options
context:
space:
mode:
authorAlex Zolotarev <alex@maps.me>2015-09-08 22:08:35 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 03:04:07 +0300
commit2c2cf65a0c30c9a53cf74ca92ab622f7f3791812 (patch)
treee343c1da8ecffc4b711a62a64e72a2fef0663908 /iphone
parentc3ab639c71a6b8fac8f78f688e223db955dcc0aa (diff)
[ios] Correctly handle return value for application:didFinishLaunchingWithOptions:
@TODO: Should we return immediately and do nothing if we have an url but can’t handle it?
Diffstat (limited to 'iphone')
-rw-r--r--iphone/Maps/Classes/MapsAppDelegate.mm15
-rw-r--r--iphone/Maps/Statistics/Statistics.h2
-rw-r--r--iphone/Maps/Statistics/Statistics.mm6
3 files changed, 13 insertions, 10 deletions
diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm
index dd3ba1440a..dade6af005 100644
--- a/iphone/Maps/Classes/MapsAppDelegate.mm
+++ b/iphone/Maps/Classes/MapsAppDelegate.mm
@@ -156,12 +156,15 @@ void InitLocalizedStrings()
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Initialize all 3party engines.
- [[Statistics instance] application:application didFinishLaunchingWithOptions:launchOptions];
+ BOOL returnValue = [[Statistics instance] application:application
+ didFinishLaunchingWithOptions:launchOptions];
+
+ NSURL * urlUsedToLaunchMaps = launchOptions[UIApplicationLaunchOptionsURLKey];
+ if (urlUsedToLaunchMaps != nil)
+ returnValue |= [self checkLaunchURL:urlUsedToLaunchMaps];
+ else
+ returnValue = YES;
- NSURL * url = launchOptions[UIApplicationLaunchOptionsURLKey];
- if (url != nil)
- [self checkLaunchURL:url];
-
[HttpThread setDownloadIndicatorProtocol:[MapsAppDelegate theApp]];
[self trackWatchUser];
@@ -215,7 +218,7 @@ void InitLocalizedStrings()
application.applicationIconBadgeNumber = f.GetCountryTree().GetActiveMapLayout().GetOutOfDateCount();
f.GetLocationState()->InvalidatePosition();
- return YES;
+ return returnValue;
}
- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
diff --git a/iphone/Maps/Statistics/Statistics.h b/iphone/Maps/Statistics/Statistics.h
index ee6a8046d0..cc64b8f8a1 100644
--- a/iphone/Maps/Statistics/Statistics.h
+++ b/iphone/Maps/Statistics/Statistics.h
@@ -6,7 +6,7 @@
- (void)disableOnNextAppLaunch;
// Should be called from the same method in AppDelegate.
-- (void)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
// Should be called from the same method in AppDelegate.
- (void)applicationDidBecomeActive;
- (void)logEvent:(NSString *)eventName;
diff --git a/iphone/Maps/Statistics/Statistics.mm b/iphone/Maps/Statistics/Statistics.mm
index bf28a5f639..025abdbc4f 100644
--- a/iphone/Maps/Statistics/Statistics.mm
+++ b/iphone/Maps/Statistics/Statistics.mm
@@ -70,15 +70,13 @@ char const * kStatisticsEnabledSettingsKey = "StatisticsEnabled";
[Alohalytics logEvent:@"statisticsDisabled"];
}
-- (void)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// _enabled should be already correctly set up in init method.
if (_enabled)
{
[Flurry startSession:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"FlurryKey"]];
- [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
-
[MRMyTracker createTracker:@"***REMOVED***"];
#ifdef DEBUG
[MRMyTracker setDebugMode:YES];
@@ -88,6 +86,8 @@ char const * kStatisticsEnabledSettingsKey = "StatisticsEnabled";
[Alohalytics setup:@"http://localhost:8080" withLaunchOptions:launchOptions];
}
+ // Always call Facebook method, looks like it is required to handle some url schemes and sign on scenarios.
+ return [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
}
- (void)logLocation:(CLLocation *)location