Skip to content

Commit b0acf90

Browse files
committed
use full locate id instead of just language code
1 parent 3edc0a6 commit b0acf90

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

TinodeSDK/Tinode.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ public class Tinode {
165165
let kProtocolVersion = "0"
166166
let kVersion = "0.23"
167167
let kLibVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String
168-
let kLocale = Locale.current.languageCode!
169168

170169
public var OsVersion: String = ""
171170

@@ -494,7 +493,7 @@ public class Tinode {
494493
}
495494

496495
public var userAgent: String {
497-
return "\(appName) (iOS \(OsVersion); \(kLocale)); tinode-swift/\(kLibVersion)"
496+
return "\(appName) (iOS \(OsVersion); \(Locale.current.identifier)); tinode-swift/\(kLibVersion)"
498497
}
499498

500499
public func getServerLimit(for key: String, withDefault defVal: Int64) -> Int64 {
@@ -689,7 +688,7 @@ public class Tinode {
689688

690689
private func hello(inBackground bkg: Bool) -> PromisedReply<ServerMessage> {
691690
let msgId = getNextMsgId()
692-
let msg = ClientMessage<Int, Int>(hi: MsgClientHi(id: msgId, ver: kVersion, ua: userAgent, dev: deviceToken, lang: kLocale, background: bkg))
691+
let msg = ClientMessage<Int, Int>(hi: MsgClientHi(id: msgId, ver: kVersion, ua: userAgent, dev: deviceToken, lang: Locale.current.identifier, background: bkg))
693692
return sendWithPromise(payload: msg, with: msgId)
694693
.thenApply({ [weak self] pkt in
695694
guard let ctrl = pkt?.ctrl else {

0 commit comments

Comments
 (0)