iOS (Analytics-Swift)

To integrate Segment's iOS SDK (Analytics-Swift) with a custom API host:

import Analytics

var analytics: Analytics? = nil

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  // Override point for customization after application launch.
  let configuration = Configuration(writeKey: "<EVEFAN_SOURCE_WRITE_KEY>")
    .trackApplicationLifecycleEvents(true)
    .apiHost("<EVEFAN_WORKER_HOST>/v1")
	
  analytics = Analytics(configuration: configuration)
}

Here's their official guide.

Last updated