mirror of
https://github.com/hub-team/OnlineChatSdk-SwiftPM.git
synced 2026-04-15 09:03:05 +00:00
update 0.1.2
This commit is contained in:
@@ -213,7 +213,6 @@ open class ChatController: UIViewController, WKNavigationDelegate, WKScriptMessa
|
|||||||
if apiToken != "" {
|
if apiToken != "" {
|
||||||
ChatConfig.setApiToken(apiToken)
|
ChatConfig.setApiToken(apiToken)
|
||||||
}
|
}
|
||||||
|
|
||||||
var setup: Dictionary<String, Any> = [:]
|
var setup: Dictionary<String, Any> = [:]
|
||||||
if !language.isEmpty {
|
if !language.isEmpty {
|
||||||
setup["language"] = language
|
setup["language"] = language
|
||||||
@@ -223,6 +222,13 @@ open class ChatController: UIViewController, WKNavigationDelegate, WKScriptMessa
|
|||||||
}
|
}
|
||||||
widgetUrl = "https://admin.verbox.ru/support/chat/\(id)/\(domain)"
|
widgetUrl = "https://admin.verbox.ru/support/chat/\(id)/\(domain)"
|
||||||
var url = URL(string: widgetUrl)
|
var url = URL(string: widgetUrl)
|
||||||
|
if url == nil {
|
||||||
|
var encodeDomain = String(describing: domain.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed))
|
||||||
|
encodeDomain = encodeDomain.replacingOccurrences(of: "Optional(\"", with: "")
|
||||||
|
encodeDomain = encodeDomain.replacingOccurrences(of: "\")", with: "")
|
||||||
|
widgetUrl = "https://admin.verbox.ru/support/chat/\(id)/\(encodeDomain)"
|
||||||
|
url = URL(string: widgetUrl)
|
||||||
|
}
|
||||||
var urlComponents = URLComponents(url: url!, resolvingAgainstBaseURL: false)
|
var urlComponents = URLComponents(url: url!, resolvingAgainstBaseURL: false)
|
||||||
if !setup.isEmpty {
|
if !setup.isEmpty {
|
||||||
if (showCloseButton) {
|
if (showCloseButton) {
|
||||||
|
|||||||
Reference in New Issue
Block a user