summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall C Lee <randallee@gmail.com>2018-07-27 15:56:55 -0400
committerRandall C Lee <randallee@gmail.com>2018-07-27 15:56:55 -0400
commit5dbd6c4c6d528cf8fc0302c1d307a733a01f3e8e (patch)
tree80f3948eb9869d2b062829438e4c822f141ccf3d
parent04cfbeaa6d22d01d6c878a7ed985e8aededda512 (diff)
downloadqtlocation-mapboxgl-5dbd6c4c6d528cf8fc0302c1d307a733a01f3e8e.tar.gz
Add events logging wrapper
-rw-r--r--platform/ios/ios.xcodeproj/project.pbxproj8
-rw-r--r--platform/ios/src/MGLMapboxEvents.h1
-rw-r--r--platform/ios/src/MGLMapboxEvents.m4
-rw-r--r--platform/ios/src/MGLMapboxEventsLogging.h12
-rw-r--r--platform/ios/src/MGLMapboxEventsLogging.m9
5 files changed, 34 insertions, 0 deletions
diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj
index e53e649c02..a0c4e0b8ee 100644
--- a/platform/ios/ios.xcodeproj/project.pbxproj
+++ b/platform/ios/ios.xcodeproj/project.pbxproj
@@ -359,6 +359,8 @@
AC518E00201BB55A00EBC820 /* MGLTelemetryConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = AC518DFD201BB55A00EBC820 /* MGLTelemetryConfig.h */; };
AC518E03201BB56000EBC820 /* MGLTelemetryConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = AC518DFE201BB55A00EBC820 /* MGLTelemetryConfig.m */; };
AC518E04201BB56100EBC820 /* MGLTelemetryConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = AC518DFE201BB55A00EBC820 /* MGLTelemetryConfig.m */; };
+ ACC60840210BAEB700917711 /* MGLMapboxEventsLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = ACC6083E210BAEB200917711 /* MGLMapboxEventsLogging.m */; };
+ ACC60841210BAEB700917711 /* MGLMapboxEventsLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = ACC6083E210BAEB200917711 /* MGLMapboxEventsLogging.m */; };
ACF969F220CB04E600B23FB7 /* MMEEventsService.m in Sources */ = {isa = PBXBuildFile; fileRef = ACF969F020CB04E500B23FB7 /* MMEEventsService.m */; };
ACF969F320CB04E600B23FB7 /* MMEEventsService.m in Sources */ = {isa = PBXBuildFile; fileRef = ACF969F020CB04E500B23FB7 /* MMEEventsService.m */; };
ACF969F420CB04E600B23FB7 /* MMEEventsService.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF969F120CB04E500B23FB7 /* MMEEventsService.h */; };
@@ -996,6 +998,8 @@
96F3F73B1F5711F1003E2D2C /* MGLUserLocationHeadingIndicator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLUserLocationHeadingIndicator.h; sourceTree = "<group>"; };
AC518DFD201BB55A00EBC820 /* MGLTelemetryConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLTelemetryConfig.h; sourceTree = "<group>"; };
AC518DFE201BB55A00EBC820 /* MGLTelemetryConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLTelemetryConfig.m; sourceTree = "<group>"; };
+ ACC6083D210BAEB200917711 /* MGLMapboxEventsLogging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLMapboxEventsLogging.h; sourceTree = "<group>"; };
+ ACC6083E210BAEB200917711 /* MGLMapboxEventsLogging.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLMapboxEventsLogging.m; sourceTree = "<group>"; };
ACF969F020CB04E500B23FB7 /* MMEEventsService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MMEEventsService.m; path = "vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventsService.m"; sourceTree = SOURCE_ROOT; };
ACF969F120CB04E500B23FB7 /* MMEEventsService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MMEEventsService.h; path = "vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventsService.h"; sourceTree = SOURCE_ROOT; };
CA0C27912076C804001CE5B7 /* MGLShapeSourceTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLShapeSourceTests.m; sourceTree = "<group>"; };
@@ -2177,6 +2181,8 @@
children = (
AC518DFD201BB55A00EBC820 /* MGLTelemetryConfig.h */,
AC518DFE201BB55A00EBC820 /* MGLTelemetryConfig.m */,
+ ACC6083D210BAEB200917711 /* MGLMapboxEventsLogging.h */,
+ ACC6083E210BAEB200917711 /* MGLMapboxEventsLogging.m */,
40834BA21FE05D3100C1BD0D /* Runtime */,
40834BA11FE05CFD00C1BD0D /* Development */,
);
@@ -2953,6 +2959,7 @@
3566C76E1D4A8DFA008152BC /* MGLRasterTileSource.mm in Sources */,
DA88488C1CBB037E00AB86E3 /* SMCalloutView.m in Sources */,
35136D4E1D4277FC00C20EFD /* MGLSource.mm in Sources */,
+ ACC60841210BAEB700917711 /* MGLMapboxEventsLogging.m in Sources */,
1F06668D1EC64F8E001C16D7 /* MGLLight.mm in Sources */,
DA35A2B81CCA9A5D00E826B2 /* MGLClockDirectionFormatter.m in Sources */,
DAD1657A1CF4CDFF001FF4B9 /* MGLShapeCollection.mm in Sources */,
@@ -3079,6 +3086,7 @@
35136D4F1D4277FC00C20EFD /* MGLSource.mm in Sources */,
DA35A2B91CCA9A5D00E826B2 /* MGLClockDirectionFormatter.m in Sources */,
DAD1657B1CF4CDFF001FF4B9 /* MGLShapeCollection.mm in Sources */,
+ ACC60840210BAEB700917711 /* MGLMapboxEventsLogging.m in Sources */,
DAA4E4251CBB730400178DFB /* MGLShape.mm in Sources */,
35136D461D42275100C20EFD /* MGLSymbolStyleLayer.mm in Sources */,
DAF2571A201901E200367EF5 /* MGLHillshadeStyleLayer.mm in Sources */,
diff --git a/platform/ios/src/MGLMapboxEvents.h b/platform/ios/src/MGLMapboxEvents.h
index cbac578798..6b8eedfbb1 100644
--- a/platform/ios/src/MGLMapboxEvents.h
+++ b/platform/ios/src/MGLMapboxEvents.h
@@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (void)pushEvent:(NSString *)event withAttributes:(MMEMapboxEventAttributes *)attributeDictionary;
+ (void)flush;
+ (void)ensureMetricsOptoutExists;
++ (void)displayLogFileFromDate:(NSDate *)logDate;
@end
diff --git a/platform/ios/src/MGLMapboxEvents.m b/platform/ios/src/MGLMapboxEvents.m
index e9f27b3446..e6e96fb83f 100644
--- a/platform/ios/src/MGLMapboxEvents.m
+++ b/platform/ios/src/MGLMapboxEvents.m
@@ -195,4 +195,8 @@ static NSString * const MGLVariableGeofence = @"VariableGeofence";
}
}
++ (void)displayLogFileFromDate:(NSDate *)logDate {
+ [[[self sharedInstance] eventsManager] displayLogFileFromDate:logDate];
+}
+
@end
diff --git a/platform/ios/src/MGLMapboxEventsLogging.h b/platform/ios/src/MGLMapboxEventsLogging.h
new file mode 100644
index 0000000000..5fbf727b20
--- /dev/null
+++ b/platform/ios/src/MGLMapboxEventsLogging.h
@@ -0,0 +1,12 @@
+#import <Foundation/Foundation.h>
+#import "MGLMapboxEvents.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface MGLMapboxEventsLogging : NSObject
+
++ (void)displayLogFileFromDate:(NSDate *)logDate;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/platform/ios/src/MGLMapboxEventsLogging.m b/platform/ios/src/MGLMapboxEventsLogging.m
new file mode 100644
index 0000000000..f897561c8c
--- /dev/null
+++ b/platform/ios/src/MGLMapboxEventsLogging.m
@@ -0,0 +1,9 @@
+#import "MGLMapboxEventsLogging.h"
+
+@implementation MGLMapboxEventsLogging
+
++ (void)displayLogFileFromDate:(NSDate *)logDate {
+ [MGLMapboxEvents displayLogFileFromDate:logDate];
+}
+
+@end