diff options
author | Jesse Bounds <jesse@rebounds.net> | 2016-11-28 16:14:02 -0800 |
---|---|---|
committer | Jesse Bounds <jesse@rebounds.net> | 2016-11-30 16:19:22 -0800 |
commit | e9504912dc4eca1793be200cc46c14d81fbf1ee5 (patch) | |
tree | c656ac9dace3af36c4ec0d78f33d998c11d99e87 /platform/ios/src/MGLMapboxEvents.m | |
parent | 37a087c675b847f64dd73a570c11b4ddebac35fb (diff) | |
download | qtlocation-mapboxgl-e9504912dc4eca1793be200cc46c14d81fbf1ee5.tar.gz |
[ios] Use new pinning cert for staging
This updates the cert for the staging environment. It also adjusts the
telem implementation to send along the horizontal accuracy for each
location event and removes the previous battery level gathering logic.
Diffstat (limited to 'platform/ios/src/MGLMapboxEvents.m')
-rw-r--r-- | platform/ios/src/MGLMapboxEvents.m | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/platform/ios/src/MGLMapboxEvents.m b/platform/ios/src/MGLMapboxEvents.m index d86114d016..a8de1bb585 100644 --- a/platform/ios/src/MGLMapboxEvents.m +++ b/platform/ios/src/MGLMapboxEvents.m @@ -35,6 +35,7 @@ NSString *const MGLEventKeyZoomLevel = @"zoom"; NSString *const MGLEventKeySpeed = @"speed"; NSString *const MGLEventKeyCourse = @"course"; NSString *const MGLEventKeyGestureID = @"gesture"; +NSString *const MGLEventHorizontalAccuracy = @"horizontalAccuracy"; NSString *const MGLEventKeyLocalDebugDescription = @"debug.description"; static NSString *const MGLEventKeyEvent = @"event"; @@ -46,7 +47,6 @@ static NSString *const MGLEventKeyOperatingSystem = @"operatingSystem"; static NSString *const MGLEventKeyResolution = @"resolution"; static NSString *const MGLEventKeyAccessibilityFontScale = @"accessibilityFontScale"; static NSString *const MGLEventKeyOrientation = @"orientation"; -static NSString *const MGLEventKeyBatteryLevel = @"batteryLevel"; static NSString *const MGLEventKeyPluggedIn = @"pluggedIn"; static NSString *const MGLEventKeyWifi = @"wifi"; static NSString *const MGLEventKeySource = @"source"; @@ -190,9 +190,6 @@ const NSTimeInterval MGLFlushInterval = 180; // Clear Any System TimeZone Cache [NSTimeZone resetSystemTimeZone]; [_rfc3339DateFormatter setTimeZone:[NSTimeZone systemTimeZone]]; - - // Enable Battery Monitoring - [UIDevice currentDevice].batteryMonitoringEnabled = YES; // Configure logging if ([self isProbablyAppStoreBuild]) { @@ -454,7 +451,6 @@ const NSTimeInterval MGLFlushInterval = 180; MGLEventKeyResolution: @(self.data.scale), MGLEventKeyAccessibilityFontScale: @([self contentSizeScale]), MGLEventKeyOrientation: [self deviceOrientation], - MGLEventKeyBatteryLevel: @([self batteryLevel]), MGLEventKeyWifi: @([[MGLReachability reachabilityForLocalWiFi] isReachableViaWiFi])} mutableCopy]; [self addBatteryStateToAttributes:attributes]; return [self eventForAttributes:attributes attributeDictionary:attributeDictionary]; @@ -475,7 +471,6 @@ const NSTimeInterval MGLFlushInterval = 180; - (MGLMutableMapboxEventAttributes *)interactionEvent { MGLMutableMapboxEventAttributes *attributes = [@{MGLEventKeyCreated: [self.rfc3339DateFormatter stringFromDate:[NSDate date]], MGLEventKeyOrientation: [self deviceOrientation], - MGLEventKeyBatteryLevel: @([self batteryLevel]), MGLEventKeyWifi: @([[MGLReachability reachabilityForLocalWiFi] isReachableViaWiFi])} mutableCopy]; [self addBatteryStateToAttributes:attributes]; return attributes; @@ -519,10 +514,6 @@ const NSTimeInterval MGLFlushInterval = 180; repeats:YES]; } -- (NSInteger)batteryLevel { - return [[NSNumber numberWithFloat:roundf(100 * [UIDevice currentDevice].batteryLevel)] integerValue]; -} - - (NSString *)deviceOrientation { NSString *result; @@ -665,11 +656,13 @@ const NSTimeInterval MGLFlushInterval = 180; double accuracy = 10000000; double lat = floor(loc.coordinate.latitude * accuracy) / accuracy; double lng = floor(loc.coordinate.longitude * accuracy) / accuracy; + double horizontalAccuracy = loc.horizontalAccuracy; NSString *formattedDate = [self.rfc3339DateFormatter stringFromDate:loc.timestamp]; [MGLMapboxEvents pushEvent:MGLEventTypeLocation withAttributes:@{MGLEventKeyCreated: formattedDate, MGLEventKeyLatitude: @(lat), MGLEventKeyLongitude: @(lng), - MGLEventKeyAltitude: @(round(loc.altitude))}]; + MGLEventKeyAltitude: @(round(loc.altitude)), + MGLEventHorizontalAccuracy: @(horizontalAccuracy)}]; } } |