Skip to content
Open
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
14 changes: 7 additions & 7 deletions Sources/Aptabase/Aptabase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@ public class Aptabase: NSObject {
]

private func getBaseUrl(_ region: String, _ host: String?) -> String? {
guard var baseURL = hosts[region] else { return nil }
if region == "SH" {
guard let host else {
debugPrint("Aptabase: Host parameter must be defined when using Self-Hosted App Key. Tracking will be disabled.")
return nil
}
baseURL = host
if let host {
return host
}

guard let baseURL = hosts[region], !baseURL.isEmpty else {
debugPrint("Aptabase: Host parameter must be defined when using Self-Hosted App Key. Tracking will be disabled.")
return nil
}

return baseURL
Expand Down