File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ @interface SEGAnalytics ()
27
27
@property (nonatomic , strong ) SEGStoreKitTracker *storeKitTracker;
28
28
@property (nonatomic , strong ) SEGIntegrationsManager *integrationsManager;
29
29
@property (nonatomic , strong ) SEGMiddlewareRunner *runner;
30
+ @property (nonatomic , strong ) NSString *lastIDFA;
30
31
@end
31
32
32
33
@@ -47,6 +48,7 @@ - (instancetype)initWithConfiguration:(SEGAnalyticsConfiguration *)configuration
47
48
if (self = [self init ]) {
48
49
self.oneTimeConfiguration = configuration;
49
50
self.enabled = YES ;
51
+ self.lastIDFA = nil ;
50
52
51
53
// In swift this would not have been OK... But hey.. It's objc
52
54
// TODO: Figure out if this is really the best way to do things here.
@@ -556,6 +558,16 @@ - (void)run:(SEGEventType)eventType payload:(SEGPayload *)payload
556
558
return ;
557
559
}
558
560
561
+ if (getAdTrackingEnabled (self.oneTimeConfiguration )) {
562
+ // if idfa has changed since last we looked, we need to rebuild
563
+ // the static context to pick up the change.
564
+ NSString *idfa = self.oneTimeConfiguration .adSupportBlock ();
565
+ if (![idfa isEqualToString: self .lastIDFA]) {
566
+ self.lastIDFA = idfa;
567
+ [[SEGState sharedInstance ].context updateStaticContext ];
568
+ }
569
+ }
570
+
559
571
if (self.oneTimeConfiguration .experimental .nanosecondTimestamps ) {
560
572
payload.timestamp = iso8601NanoFormattedString ([NSDate date ]);
561
573
} else {
You can’t perform that action at this time.
0 commit comments