Use AppInfo to get version string

This commit is contained in:
Johannes Marbach 2022-09-26 12:17:47 +02:00
parent 4cbbb95b62
commit 2060482fa2

View file

@ -106,7 +106,7 @@ class CommonConfiguration: NSObject, Configurable {
private func makeUserAgent() -> String? { private func makeUserAgent() -> String? {
let clientName = Bundle.main.object(forInfoDictionaryKey: kCFBundleExecutableKey as String) as? String ?? Bundle.main.object(forInfoDictionaryKey: kCFBundleIdentifierKey as String) as? String ?? "unknown" let clientName = Bundle.main.object(forInfoDictionaryKey: kCFBundleExecutableKey as String) as? String ?? Bundle.main.object(forInfoDictionaryKey: kCFBundleIdentifierKey as String) as? String ?? "unknown"
let clientVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? Bundle.main.object(forInfoDictionaryKey: kCFBundleVersionKey as String) as? String ?? "unknown" let clientVersion = AppInfo.current.appVersion?.bundleShortVersion ?? "unknown"
#if os(iOS) #if os(iOS)
return String( return String(