Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Examples/destination_plugins/ExampleDestination.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ import Segment
An implementation of the Example Analytics device mode destination as a plugin.
*/

class ExampleDestination: DestinationPlugin {
let timeline = Timeline()
let type = PluginType.destination
public class ExampleDestination: DestinationPlugin {
public let timeline = Timeline()
public let type = PluginType.destination
// TODO: Fill this out with your settings key that matches your destination in the Segment App
let key = "Example"
var analytics: Analytics? = nil
public let key = "Example"
public var analytics: Analytics? = nil

private var exampleSettings: ExampleSettings?

func update(settings: Settings, type: UpdateType) {
public func update(settings: Settings, type: UpdateType) {
// Skip if you have a singleton and don't want to keep updating via settings.
guard type == .initial else { return }

Expand All @@ -62,7 +62,7 @@ class ExampleDestination: DestinationPlugin {
// TODO: initialize partner SDK here
}

func identify(event: IdentifyEvent) -> IdentifyEvent? {
public func identify(event: IdentifyEvent) -> IdentifyEvent? {

if let _ = event.traits?.dictionaryValue {
// TODO: Do something with traits if they exist
Expand All @@ -73,7 +73,7 @@ class ExampleDestination: DestinationPlugin {
return event
}

func track(event: TrackEvent) -> TrackEvent? {
public func track(event: TrackEvent) -> TrackEvent? {

var returnEvent = event

Expand All @@ -88,7 +88,7 @@ class ExampleDestination: DestinationPlugin {
return returnEvent
}

func screen(event: ScreenEvent) -> ScreenEvent? {
public func screen(event: ScreenEvent) -> ScreenEvent? {

if let _ = event.properties?.dictionaryValue {
// TODO: Do something with properties if they exist
Expand All @@ -99,7 +99,7 @@ class ExampleDestination: DestinationPlugin {
return event
}

func group(event: GroupEvent) -> GroupEvent? {
public func group(event: GroupEvent) -> GroupEvent? {

if let _ = event.traits?.dictionaryValue {
// TODO: Do something with traits if they exist
Expand All @@ -110,7 +110,7 @@ class ExampleDestination: DestinationPlugin {
return event
}

func alias(event: AliasEvent) -> AliasEvent? {
public func alias(event: AliasEvent) -> AliasEvent? {

// TODO: Do something with previousId & userId in partner SDK

Expand Down
12 changes: 4 additions & 8 deletions Segment.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@
46B1AC6827346D3D00846DE8 /* StressTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StressTests.swift; sourceTree = "<group>"; };
46D98E3D26D6FEF300E7A86A /* FlurryDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlurryDestination.swift; sourceTree = "<group>"; };
46D98E3E26D6FEF300E7A86A /* AdjustDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdjustDestination.swift; sourceTree = "<group>"; };
46D98E3F26D6FEF300E7A86A /* MixpanelDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixpanelDestination.swift; sourceTree = "<group>"; };
46D98E4026D6FEF300E7A86A /* AppsFlyerDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppsFlyerDestination.swift; sourceTree = "<group>"; };
46D98E4126D6FEF300E7A86A /* FirebaseDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirebaseDestination.swift; sourceTree = "<group>"; };
46D98E4226D6FEF300E7A86A /* AmplitudeSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmplitudeSession.swift; sourceTree = "<group>"; };
46D98E4426D6FEF300E7A86A /* UIKitScreenTracking.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIKitScreenTracking.swift; sourceTree = "<group>"; };
46D98E4526D6FEF300E7A86A /* ConsentTracking.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsentTracking.swift; sourceTree = "<group>"; };
46D98E4626D6FEF300E7A86A /* IDFACollection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IDFACollection.swift; sourceTree = "<group>"; };
Expand All @@ -150,6 +146,8 @@
46FE4CFA25A6C671003A7362 /* TestUtilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestUtilities.swift; sourceTree = "<group>"; };
46FE4D1C25A7A850003A7362 /* Storage_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Storage_Tests.swift; sourceTree = "<group>"; };
759D6CD027B48ABB00AB900A /* DestinationMetadataPlugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DestinationMetadataPlugin.swift; sourceTree = "<group>"; };
7B3C818F285BAD7600199D3E /* ComscoreDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComscoreDestination.swift; sourceTree = "<group>"; };
7B3C8190285BAD8700199D3E /* IntercomDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntercomDestination.swift; sourceTree = "<group>"; };
9620862B2575C0C800314F8D /* Events.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Events.swift; sourceTree = "<group>"; };
962086482579CCC200314F8D /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
9620864F257AA83E00314F8D /* iOSLifecycleMonitor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSLifecycleMonitor.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -256,13 +254,11 @@
46D98E3C26D6FEF300E7A86A /* destination_plugins */ = {
isa = PBXGroup;
children = (
7B3C8190285BAD8700199D3E /* IntercomDestination.swift */,
7B3C818F285BAD7600199D3E /* ComscoreDestination.swift */,
46D98E3E26D6FEF300E7A86A /* AdjustDestination.swift */,
46D98E4226D6FEF300E7A86A /* AmplitudeSession.swift */,
46D98E4026D6FEF300E7A86A /* AppsFlyerDestination.swift */,
9679DD6226EFF00800A6933C /* ExampleDestination.swift */,
46D98E4126D6FEF300E7A86A /* FirebaseDestination.swift */,
46D98E3D26D6FEF300E7A86A /* FlurryDestination.swift */,
46D98E3F26D6FEF300E7A86A /* MixpanelDestination.swift */,
);
name = destination_plugins;
path = Examples/destination_plugins;
Expand Down