Skip to content

Commit

Permalink
[fix]: set API stage type
Browse files Browse the repository at this point in the history
  • Loading branch information
NoMoreViolence committed Dec 19, 2024
1 parent a3a412f commit 1eba0f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 5 additions & 4 deletions BluxClient/Classes/BluxClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,17 @@ struct PropertiesWrapper<T: Codable>: Codable {
}

@objc public static func setAPIStage(_ stage: String) {
if stage == "prod" {
let uppercasedStage = stage.uppercased()
if uppercasedStage == "PROD" {
HTTPClient.shared.setAPIStage(HTTPClient.APIBaseURLByStage.prod)
return
} else if stage == "stg" {
} else if uppercasedStage == "STG" {
HTTPClient.shared.setAPIStage(HTTPClient.APIBaseURLByStage.stg)
return
} else if stage == "dev" {
} else if uppercasedStage == "DEV" {
HTTPClient.shared.setAPIStage(HTTPClient.APIBaseURLByStage.dev)
return
} else if stage == "local" {
} else if uppercasedStage == "LOCAL" {
HTTPClient.shared.setAPIStage(HTTPClient.APIBaseURLByStage.local)
return
}
Expand Down
8 changes: 8 additions & 0 deletions BluxClient/Classes/request/events/Event.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ public class Event: Codable {
return self
}

@discardableResult
public func setEventProperties(_ eventProperties: EventProperties?) -> Event {
if let eventProperties = eventProperties {
self.eventProperties = eventProperties
}
return self
}

@discardableResult
public func setCustomEventProperties(_ customEventProperties: [String: String]?) -> Event {
self.customEventProperties = customEventProperties
Expand Down

0 comments on commit 1eba0f3

Please sign in to comment.