Skip to content

Commit

Permalink
update for 3.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Sergey-K committed Jul 20, 2023
1 parent 4e0bea5 commit e4c15cc
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 21 deletions.
45 changes: 28 additions & 17 deletions Core/UDValidationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,16 @@ public class UDValidationManager {
errorBlock(.urlError, UDError.urlError.description)
return
}
model.urlWithoutPort = url!
var urlValue = url!
if urlValue.last == "/" && urlValue.count > 2 {
urlValue.removeLast()
}
model.urlWithoutPort = urlValue

if isExistProtocol(url: url!) {
model.url = "\(url!):\(model.port)"
if isExistProtocol(url: urlValue) {
model.url = "\(urlValue):\(model.port)"
} else {
model.url = "https://" + "\(url!):\(model.port)"
model.url = "https://" + "\(urlValue):\(model.port)"
}
}

Expand All @@ -96,31 +100,38 @@ public class UDValidationManager {
}
}

if urlToSendFile != nil {
if urlToSendFile != "" {
guard urlToSendFile!.udIsValidUrl() else {
if let url = urlToSendFile {
if url != "" {
var urlValue = url
guard urlValue.udIsValidUrl() else {
errorBlock(.urlToSendFileError, UDError.urlToSendFileError.description)
return
}
if isExistProtocol(url: urlToSendFile!) {
model.urlToSendFile = urlToSendFile!
if urlValue.last == "/" && urlValue.count > 2 {
urlValue.removeLast()
}
if isExistProtocol(url: urlValue) {
model.urlToSendFile = urlValue
} else {
model.urlToSendFile = "https://" + urlToSendFile!
model.urlToSendFile = "https://" + urlValue
}
}
}

if urlAPI != nil {
if urlAPI != "" {
var urlAPIValue = urlAPI!
if !isExistProtocol(url: urlAPIValue) {
urlAPIValue = "https://" + urlAPIValue
if let url = urlAPI {
if url != "" {
var urlValue = url
if !isExistProtocol(url: urlValue) {
urlValue = "https://" + urlValue
}
guard urlAPIValue.udIsValidUrl() else {
guard urlValue.udIsValidUrl() else {
errorBlock(.urlAPIError, UDError.urlAPIError.description)
return
}
model.urlAPI = urlAPIValue
if urlValue.last == "/" && urlValue.count > 2 {
urlValue.removeLast()
}
model.urlAPI = urlValue
}
}

Expand Down
2 changes: 1 addition & 1 deletion Core/UseDeskSDKHelp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class UseDeskSDKHelp {
let payload: [String : Any] = [
"sdk" : "iOS",
"type" : "sdk",
"version" : "3.4.4",
"version" : "3.4.5",
"message_limit" : countMessagesOnInit,
"userData" : getUserParameters()
]
Expand Down
4 changes: 2 additions & 2 deletions Example/UseDesk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@
INFOPLIST_FILE = "UseDesk/UseDesk-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.4.4;
MARKETING_VERSION = 3.4.5;
MODULE_NAME = ExampleApp;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = UseDeskExampleSDK.ru;
Expand Down Expand Up @@ -622,7 +622,7 @@
INFOPLIST_FILE = "UseDesk/UseDesk-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.4.4;
MARKETING_VERSION = 3.4.5;
MODULE_NAME = ExampleApp;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = UseDeskExampleSDK.ru;
Expand Down
2 changes: 1 addition & 1 deletion UseDesk_SDK_Swift.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'UseDesk_SDK_Swift'
s.version = '3.4.4'
s.version = '3.4.5'
s.summary = 'A short description of UseDesk.'

s.homepage = 'https://github.com/usedesk/UseDeskSwift'
Expand Down

0 comments on commit e4c15cc

Please sign in to comment.