Skip to content

Setting the apiHost in the configuration has no effect #156

@jgable

Description

@jgable

Describe the bug
Setting the apiHost in the configuration has no effect, events are still sent to api.segment.io/v1 regardless of the configuration values for apiHost.

let configuration = Configuration(writeKey: writeKey)
   .trackApplicationLifecycleEvents(true)
   .apiHost("analytics-ingestion.kraftful.com")
   .flushInterval(10)

Analytics.debugLogsEnabled = true
analytics = Analytics(configuration: configuration)

Steps for repro:

I have created an example app with repro in a fork: https://github.com/kraftful/analytics-swift/tree/jgable/api-host-repro (specific commit is ce5331d)

  • Clone the above branch/commit
  • Load the ExampleApp project in XCode (in the Examples/APIHostConfigurationRepro folder)
  • Put breakpoints in the HTTPClient file in Segment package where the batch uploads happen
  • Run the app on simulator (I have tried iPhone 12 Pro)
  • Login using creds: test@test.com, test1234
  • Observe the value of uploadURL in the debugger when the batch is uploaded

Expected:

  • Should be analytics-ingestion.kraftful.com since that is passed in the configuration in the SegmentAnalytlics.swift file

Actual:

  • api.segment.io/v1 is used instead.

Expected behavior

Event batches should be sent to the configured apiHost.

Screenshots

Screen Shot 2022-09-20 at 9 41 05 AM

Platform (please complete the following information):

  • Library Version in use: latest
  • Platform being tested: iOS (latest)
  • Integrations in use: none

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions