File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,8 @@ public class SegmentDestination: DestinationPlugin {
72
72
73
73
// MARK: - Event Handling Methods
74
74
public func execute< T: RawEvent > ( event: T ? ) -> T ? {
75
- let result : T ? = event
75
+ guard let event = event else { return nil }
76
+ let result = process ( incomingEvent: event)
76
77
if let r = result {
77
78
queueEvent ( event: r)
78
79
}
Original file line number Diff line number Diff line change @@ -358,9 +358,13 @@ final class Analytics_Tests: XCTestCase {
358
358
let analytics = Analytics ( configuration: Configuration ( writeKey: " test " ) )
359
359
let mixpanel = AnyDestination ( key: " Mixpanel " )
360
360
let outputReader = OutputReaderPlugin ( )
361
- analytics. add ( plugin: outputReader)
361
+
362
+ // we want the output reader on the segment plugin
363
+ // cuz that's the only place the metadata is getting added.
364
+ let segmentDest = analytics. find ( pluginType: SegmentDestination . self)
365
+ segmentDest? . add ( plugin: outputReader)
366
+
362
367
analytics. add ( plugin: mixpanel)
363
- analytics. add ( plugin: DestinationMetadataPlugin ( ) )
364
368
var settings = Settings ( writeKey: " 123 " )
365
369
let integrations = try ? JSON ( [
366
370
" Segment.io " : JSON ( [
You can’t perform that action at this time.
0 commit comments