#1162 - Adding appBundleId as an event attribute

This commit is contained in:
Brad Leege
2015-03-31 09:46:28 -05:00
parent 48a987c373
commit adcbf48ff5

View File

@@ -59,6 +59,7 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
@property (atomic) NSString *instanceID;
@property (atomic) NSString *advertiserId;
@property (atomic) NSString *vendorId;
@property (atomic) NSString *appBundleId;
@property (atomic) NSString *userAgent;
@property (atomic) NSString *model;
@property (atomic) NSString *iOSVersion;
@@ -115,9 +116,9 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultsToRegister];
}
NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier];
_appBundleId = [[NSBundle mainBundle] bundleIdentifier];
NSString *uniqueID = [[NSProcessInfo processInfo] globallyUniqueString];
_serialQueue = dispatch_queue_create([[NSString stringWithFormat:@"%@.%@.events.serial", bundleID, uniqueID] UTF8String], DISPATCH_QUEUE_SERIAL);
_serialQueue = dispatch_queue_create([[NSString stringWithFormat:@"%@.%@.events.serial", _appBundleId, uniqueID] UTF8String], DISPATCH_QUEUE_SERIAL);
// Configure Events Infrastructure
_eventQueue = [[NSMutableArray alloc] init];
@@ -248,6 +249,7 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
[evt setObject:weakSelf.instanceID forKey:@"instance"];
[evt setObject:weakSelf.advertiserId forKey:@"advertiserId"];
[evt setObject:weakSelf.vendorId forKey:@"vendorId"];
[evt setObject:weakSelf.appBundleId forKeyedSubscript:@"appBundleId"];
// mapbox-events-ios stock attributes
[evt setValue:[weakSelf.rfc3339DateFormatter stringFromDate:[NSDate date]] forKey:@"created"];