diff options
author | Brad Leege <bleege@gmail.com> | 2015-04-06 19:47:19 -0500 |
---|---|---|
committer | Brad Leege <bleege@gmail.com> | 2015-04-06 19:47:19 -0500 |
commit | 0a2ee766dbe65e3d23d0e5cba79776560ff29275 (patch) | |
tree | 3b8418314cb5a88f73de749b0475fd23427e19d8 | |
parent | 6262172034a439880f219b76a4e8c272ae4a2a44 (diff) | |
parent | 86d05d7eceaddd0fd49c5b75dfda0cb8688accd9 (diff) | |
download | qtlocation-mapboxgl-0a2ee766dbe65e3d23d0e5cba79776560ff29275.tar.gz |
Merge pull request #1218 from mapbox/1215-metrics
Changes To Metrics Data
-rw-r--r-- | platform/ios/MGLMapboxEvents.m | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index d21a723d94..2dfecbd778 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -164,8 +164,10 @@ NSString *const MGLEventGestureRotateStart = @"Rotation"; NSLocale *enUSPOSIXLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]; [_rfc3339DateFormatter setLocale:enUSPOSIXLocale]; - [_rfc3339DateFormatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"]; - [_rfc3339DateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; + [_rfc3339DateFormatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ssZ"]; + // Clear Any System TimeZone Cache + [NSTimeZone resetSystemTimeZone]; + [_rfc3339DateFormatter setTimeZone:[NSTimeZone systemTimeZone]]; } return self; } @@ -265,8 +267,21 @@ NSString *const MGLEventGestureRotateStart = @"Rotation"; [evt setValue:@(100 * [UIDevice currentDevice].batteryLevel) forKey:@"batteryLevel"]; [evt setValue:@(weakSelf.scale) forKey:@"resolution"]; [evt setValue:weakSelf.carrier forKey:@"carrier"]; - [evt setValue:[weakSelf getCurrentCellularNetworkConnectionType] forKey:@"cellularNetworkType"]; - [evt setValue:[weakSelf getWifiNetworkName] forKey:@"wifi"]; + + NSString *cell = [weakSelf getCurrentCellularNetworkConnectionType]; + if (cell) { + [evt setValue:cell forKey:@"cellularNetworkType"]; + } else { + [evt setObject:[NSNull null] forKey:@"cellularNetworkType"]; + } + + NSString *wifi = [weakSelf getWifiNetworkName]; + if (wifi) { + [evt setValue:wifi forKey:@"wifi"]; + } else { + [evt setObject:[NSNull null] forKey:@"wifi"]; + } + [evt setValue:@([weakSelf getContentSizeScale]) forKey:@"accessibilityFontScale"]; // Make Immutable Version @@ -505,17 +520,13 @@ NSString *const MGLEventGestureRotateStart = @"Rotation"; // - (NSString *) getWifiNetworkName { - NSString *ssid = @""; + NSString *ssid = nil; CFArrayRef interfaces = CNCopySupportedInterfaces(); if (interfaces) { NSDictionary *info = (__bridge NSDictionary *)CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(interfaces, 0)); if (info) { ssid = info[@"SSID"]; - } else { - ssid = @"NONE"; } - } else { - ssid = @"NONE"; } return ssid; @@ -528,7 +539,7 @@ NSString *const MGLEventGestureRotateStart = @"Rotation"; NSString *radioTech = telephonyInfo.currentRadioAccessTechnology; if (radioTech == nil) { - return @"NONE"; + return nil; } else if ([radioTech isEqualToString:CTRadioAccessTechnologyGPRS]) { return @"GPRS"; } else if ([radioTech isEqualToString:CTRadioAccessTechnologyEdge]) { |