forked from organicmaps/organicmaps
Merge pull request #240 from igrechuhin/ig-flurry
[ios] Added connection type tracking to Flurry.
This commit is contained in:
commit
6c404d12b9
1 changed files with 28 additions and 5 deletions
|
@ -9,6 +9,7 @@
|
|||
#import "Preferences.h"
|
||||
#import "RouteState.h"
|
||||
#import "Statistics.h"
|
||||
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
|
||||
#import <FBSDKCoreKit/FBSDKCoreKit.h>
|
||||
#import <Parse/Parse.h>
|
||||
#import <ParseFacebookUtilsV4/PFFacebookUtils.h>
|
||||
|
@ -158,8 +159,7 @@ void InitLocalizedStrings()
|
|||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
// Initialize all 3party engines.
|
||||
BOOL returnValue = [[Statistics instance] application:application
|
||||
didFinishLaunchingWithOptions:launchOptions];
|
||||
BOOL returnValue = [self initStatistics:application didFinishLaunchingWithOptions:launchOptions];
|
||||
|
||||
NSURL * urlUsedToLaunchMaps = launchOptions[UIApplicationLaunchOptionsURLKey];
|
||||
if (urlUsedToLaunchMaps != nil)
|
||||
|
@ -167,12 +167,10 @@ void InitLocalizedStrings()
|
|||
else
|
||||
returnValue = YES;
|
||||
|
||||
[HttpThread setDownloadIndicatorProtocol:[MapsAppDelegate theApp]];
|
||||
[HttpThread setDownloadIndicatorProtocol:self];
|
||||
|
||||
[self trackWatchUser];
|
||||
|
||||
[[Statistics instance] logEvent:@"Device Info" withParameters:@{@"Country" : [AppInfo sharedInfo].countryCode}];
|
||||
|
||||
InitLocalizedStrings();
|
||||
|
||||
[self.mapViewController onEnterForeground];
|
||||
|
@ -310,6 +308,31 @@ void InitLocalizedStrings()
|
|||
DeleteFramework();
|
||||
}
|
||||
|
||||
- (BOOL)initStatistics:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
Statistics * statistics = [Statistics instance];
|
||||
BOOL returnValue = [statistics application:application didFinishLaunchingWithOptions:launchOptions];
|
||||
[statistics logEvent:@"Device Info" withParameters:@{@"Country" : [AppInfo sharedInfo].countryCode}];
|
||||
|
||||
NSString * connectionType;
|
||||
switch (Platform::ConnectionStatus())
|
||||
{
|
||||
case Platform::EConnectionType::CONNECTION_NONE:
|
||||
break;
|
||||
case Platform::EConnectionType::CONNECTION_WIFI:
|
||||
connectionType = @"Wi-Fi";
|
||||
break;
|
||||
case Platform::EConnectionType::CONNECTION_WWAN:
|
||||
connectionType = [[CTTelephonyNetworkInfo alloc] init].currentRadioAccessTechnology;
|
||||
break;
|
||||
}
|
||||
if (!connectionType)
|
||||
connectionType = @"Offline";
|
||||
[statistics logEvent:@"Connection" withParameters:@{@"Type" : connectionType}];
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
- (void)disableDownloadIndicator
|
||||
{
|
||||
--m_activeDownloadsCounter;
|
||||
|
|
Loading…
Add table
Reference in a new issue