@@ -53,7 +53,7 @@ - (instancetype)initWithConfiguration:(SEGAnalyticsConfiguration *)configuration
53
53
// In swift this would not have been OK... But hey.. It's objc
54
54
// TODO: Figure out if this is really the best way to do things here.
55
55
self.integrationsManager = [[SEGIntegrationsManager alloc ] initWithAnalytics: self ];
56
-
56
+
57
57
self.runner = [[SEGMiddlewareRunner alloc ] initWithMiddleware:
58
58
[configuration.sourceMiddleware ?: @[] arrayByAddingObject: self .integrationsManager]];
59
59
@@ -110,7 +110,7 @@ - (instancetype)initWithConfiguration:(SEGAnalyticsConfiguration *)configuration
110
110
}
111
111
}
112
112
#endif
113
-
113
+
114
114
[SEGState sharedInstance ].configuration = configuration;
115
115
[[SEGState sharedInstance ].context updateStaticContext ];
116
116
}
@@ -229,7 +229,7 @@ - (void)_applicationWillEnterForeground
229
229
@" version" : currentVersion ?: @" " ,
230
230
@" build" : currentBuild ?: @" " ,
231
231
}];
232
-
232
+
233
233
[[SEGState sharedInstance ].context updateStaticContext ];
234
234
}
235
235
@@ -270,7 +270,7 @@ - (void)identify:(NSString *)userId traits:(NSDictionary *)traits
270
270
- (void )identify : (NSString *)userId traits : (NSDictionary *)traits options : (NSDictionary *)options
271
271
{
272
272
NSCAssert2 (userId.length > 0 || traits.count > 0 , @" either userId (%@ ) or traits (%@ ) must be provided." , userId, traits);
273
-
273
+
274
274
// this is done here to match functionality on android where these are inserted BEFORE being spread out amongst destinations.
275
275
// it will be set globally later when it runs through SEGIntegrationManager.identify.
276
276
NSString *anonId = [options objectForKey: @" anonymousId" ];
@@ -297,7 +297,7 @@ - (void)identify:(NSString *)userId traits:(NSDictionary *)traits options:(NSDic
297
297
// merge w/ existing traits and set them.
298
298
[existingTraitsCopy addEntriesFromDictionary: traitsCopy];
299
299
[SEGState sharedInstance ].userInfo .traits = existingTraitsCopy;
300
-
300
+
301
301
[self run: SEGEventTypeIdentify payload:
302
302
[[SEGIdentifyPayload alloc ] initWithUserId: userId
303
303
anonymousId: anonId
@@ -483,7 +483,7 @@ - (void)openURL:(NSURL *)url options:(NSDictionary *)options
483
483
if (!self.oneTimeConfiguration .trackDeepLinks ) {
484
484
return ;
485
485
}
486
-
486
+
487
487
NSString *urlString = url.absoluteString ;
488
488
[SEGState sharedInstance ].context .referrer = @{
489
489
@" url" : urlString,
@@ -549,7 +549,7 @@ + (NSString *)version
549
549
{
550
550
// this has to match the actual version, NOT what's in info.plist
551
551
// because Apple only accepts X.X.X as versions in the review process.
552
- return @" 4.1.4 " ;
552
+ return @" 4.1.5 " ;
553
553
}
554
554
555
555
#pragma mark - Helpers
@@ -559,7 +559,7 @@ - (void)run:(SEGEventType)eventType payload:(SEGPayload *)payload
559
559
if (!self.enabled ) {
560
560
return ;
561
561
}
562
-
562
+
563
563
if (getAdTrackingEnabled (self.oneTimeConfiguration )) {
564
564
// if idfa has changed since last we looked, we need to rebuild
565
565
// the static context to pick up the change.
@@ -569,13 +569,13 @@ - (void)run:(SEGEventType)eventType payload:(SEGPayload *)payload
569
569
[[SEGState sharedInstance ].context updateStaticContext ];
570
570
}
571
571
}
572
-
572
+
573
573
if (self.oneTimeConfiguration .experimental .nanosecondTimestamps ) {
574
574
payload.timestamp = iso8601NanoFormattedString ([NSDate date ]);
575
575
} else {
576
576
payload.timestamp = iso8601FormattedString ([NSDate date ]);
577
577
}
578
-
578
+
579
579
SEGContext *context = [[[SEGContext alloc ] initWithAnalytics: self ] modify: ^(id <SEGMutableContext> _Nonnull ctx) {
580
580
ctx.eventType = eventType;
581
581
ctx.payload = payload;
@@ -587,7 +587,7 @@ - (void)run:(SEGEventType)eventType payload:(SEGPayload *)payload
587
587
ctx.payload .anonymousId = [SEGState sharedInstance ].userInfo .anonymousId ;
588
588
}
589
589
}];
590
-
590
+
591
591
// Could probably do more things with callback later, but we don't use it yet.
592
592
[self .runner run: context callback: nil ];
593
593
}
0 commit comments