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 {
7272
7373 // MARK: - Event Handling Methods
7474 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)
7677 if let r = result {
7778 queueEvent ( event: r)
7879 }
Original file line number Diff line number Diff line change @@ -358,9 +358,13 @@ final class Analytics_Tests: XCTestCase {
358358 let analytics = Analytics ( configuration: Configuration ( writeKey: " test " ) )
359359 let mixpanel = AnyDestination ( key: " Mixpanel " )
360360 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+
362367 analytics. add ( plugin: mixpanel)
363- analytics. add ( plugin: DestinationMetadataPlugin ( ) )
364368 var settings = Settings ( writeKey: " 123 " )
365369 let integrations = try ? JSON ( [
366370 " Segment.io " : JSON ( [
You can’t perform that action at this time.
0 commit comments