From 30b172d9951b336480303914ad98194be6da2d7d Mon Sep 17 00:00:00 2001 From: Joris Noordermeer Date: Tue, 10 Nov 2026 14:48:08 +0900 Subject: [PATCH] fix: prioritize custom host parameter over region-based URL lookup in getBaseUrl A custom host now applies to every app key, not only self-hosted (SH) ones, so EU and US keys can send events through a proxy on the app's own domain. Co-Authored-By: Claude Opus 5.5 --- Sources/Aptabase/Aptabase.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/Aptabase/Aptabase.swift b/Sources/Aptabase/Aptabase.swift index 85404dd..017ffc8 100644 --- a/Sources/Aptabase/Aptabase.swift +++ b/Sources/Aptabase/Aptabase.swift @@ -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