File tree Expand file tree Collapse file tree 1 file changed +8
-16
lines changed
Analytics/Classes/Internal Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -106,26 +106,18 @@ - (id)initWithAnalytics:(SEGAnalytics *)analytics httpClient:(SEGHTTPClient *)ht
106
106
[self trackAttributionData: self .configuration.trackAttributionData];
107
107
}];
108
108
109
- if ([NSThread isMainThread ]) {
110
- [self setupFlushTimer ];
111
- } else {
112
- dispatch_sync (dispatch_get_main_queue (), ^{
113
- [self setupFlushTimer ];
114
- });
115
- }
109
+ self.flushTimer = [NSTimer timerWithTimeInterval: self .configuration.flushInterval
110
+ target: self
111
+ selector: @selector (flush )
112
+ userInfo: nil
113
+ repeats: YES ];
114
+
115
+ [NSRunLoop .mainRunLoop addTimer: self .flushTimer
116
+ forMode: NSDefaultRunLoopMode ];
116
117
}
117
118
return self;
118
119
}
119
120
120
- - (void )setupFlushTimer
121
- {
122
- self.flushTimer = [NSTimer scheduledTimerWithTimeInterval: self .configuration.flushInterval
123
- target: self
124
- selector: @selector (flush )
125
- userInfo: nil
126
- repeats: YES ];
127
- }
128
-
129
121
/*
130
122
* There is an iOS bug that causes instances of the CTTelephonyNetworkInfo class to
131
123
* sometimes get notifications after they have been deallocated.
You can’t perform that action at this time.
0 commit comments