Make sure device name used in core userAgent does not containt apostrophes

This commit is contained in:
QuentinArguillere 2024-11-28 10:12:44 +01:00
parent faa748fd8c
commit c6c25ce88b

View file

@ -138,7 +138,8 @@ final class CoreContext: ObservableObject {
let appName = Bundle.main.infoDictionary?["CFBundleName"] as? String
let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
self.mCore.setUserAgent(name: "\(appName ?? "Linphone")iOS/\(version ?? "6.0.0") Beta (\(UIDevice.current.localizedModel)) LinphoneSDK", version: self.coreVersion)
let userAgent = "\(appName ?? "Linphone")iOS/\(version ?? "6.0.0") Beta (\(UIDevice.current.localizedModel.replacingOccurrences(of: "'", with: ""))) LinphoneSDK"
self.mCore.setUserAgent(name: userAgent, version: self.coreVersion)
self.mCore.videoCaptureEnabled = true
self.mCore.videoDisplayEnabled = true
self.mCore.videoPreviewEnabled = false