Skip to content

Commit a7523b2

Browse files
Minor codereview fixes. Fixed typo, moved const to separate file.
1 parent c762669 commit a7523b2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

swift-sdk/ITBConsts.swift

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
import Foundation
1010

1111
@objc public class ITBConsts : NSObject {
12+
// the API endpoint
13+
public static let apiEndpoint = "https://api.iterable.com/api/"
14+
1215
public class UserDefaults {
1316
public static let objectTag = ITBL_USER_DEFAULTS_OBJECT_TAG
1417
public static let expirationTag = ITBL_USER_DEFAULTS_EXPIRATION_TAG

swift-sdk/IterableAPIImplementation+Extension.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ extension IterableAPIImplementation {
123123
}
124124

125125
private func getUrlComponents(forAction action: String) -> URLComponents? {
126-
guard var components = URLComponents(string: "\(endpoint)\(action)") else {
126+
guard var components = URLComponents(string: "\(ITBConsts.apiEndpoint)\(action)") else {
127127
return nil
128128
}
129129
components.queryItems = [URLQueryItem(name: "api_key", value: apiKey)]

swift-sdk/IterableAPIImplementation.swift

+1-4
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ import Foundation
598598
return
599599
}
600600
guard let dialogOptions = IterableInAppManager.getNextMessageFromPayload(payload) else {
601-
ITBError("No notifications found fro inApp payload \(payload)")
601+
ITBError("No notifications found for inApp payload \(payload)")
602602
return
603603
}
604604
guard let message = dialogOptions[ITERABLE_IN_APP_CONTENT] as? [AnyHashable : Any] else {
@@ -832,9 +832,6 @@ import Foundation
832832
*/
833833
var hexToken: String?
834834

835-
// the API endpoint
836-
let endpoint = "https://api.iterable.com/api/"
837-
838835
let dateProvider: DateProviderProtocol
839836

840837
var urlSession: URLSession = {

0 commit comments

Comments
 (0)