summaryrefslogtreecommitdiff
path: root/platform/ios/src
diff options
context:
space:
mode:
authorJesse Bounds <jesse@rebounds.net>2016-11-28 16:14:02 -0800
committerJesse Bounds <jesse@rebounds.net>2016-11-30 16:19:22 -0800
commite9504912dc4eca1793be200cc46c14d81fbf1ee5 (patch)
treec656ac9dace3af36c4ec0d78f33d998c11d99e87 /platform/ios/src
parent37a087c675b847f64dd73a570c11b4ddebac35fb (diff)
downloadqtlocation-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')
-rw-r--r--platform/ios/src/MGLAPIClient.m2
-rw-r--r--platform/ios/src/MGLMapboxEvents.m15
2 files changed, 5 insertions, 12 deletions
diff --git a/platform/ios/src/MGLAPIClient.m b/platform/ios/src/MGLAPIClient.m
index b9b0dc17cc..7fb6538e5d 100644
--- a/platform/ios/src/MGLAPIClient.m
+++ b/platform/ios/src/MGLAPIClient.m
@@ -122,7 +122,7 @@ static NSString * const MGLAPIClientHTTPMethodPost = @"POST";
self.geoTrustCert = certificate;
[self loadCertificate:&certificate withResource:@"api_mapbox_com-digicert"];
self.digicertCert = certificate;
- [self loadCertificate:&certificate withResource:@"star_tilestream_net"];
+ [self loadCertificate:&certificate withResource:@"api_mapbox_staging"];
self.testServerCert = certificate;
}
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)}];
}
}