Skip to content

Commit 5e55c03

Browse files
public api endpoint rename
1 parent 4f7d434 commit 5e55c03

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

sample-apps/swiftui-sample-app/swiftui-sample-app/IterableHelper.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ import IterableSDK
88
class IterableHelper {
99
// Please replace with your API key
1010
#error("Please add your API Key here")
11-
private static let apiKey = ""
11+
private static let apiKey = "a8b1a3c7b5ec48119aa976f7f5a49603"
1212

1313
static func initialize(launchOptions: [UIApplication.LaunchOptionsKey : Any]?) {
1414
let config = IterableConfig()
1515
// urlDelegate and customActionDelegate must be strong references
1616
// otherwise they will be deallocated
1717
config.urlDelegate = urlDelegate
1818
config.customActionDelegate = customActionDelegate
19+
config.dataRegion = IterableDataRegion.EU
20+
print("HIT!!!")
1921
IterableAPI.initialize(apiKey: apiKey,
2022
launchOptions: launchOptions,
2123
config: config)

swift-sdk/Internal/InternalIterableAPI.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
7878
self.dependencyContainer.createAuthManager(config: self.config)
7979
}()
8080

81-
var apiEndPoint: String {
81+
var apiEndPointForTest: String {
8282
get {
83-
_apiEndPoint
83+
apiEndPoint
8484
}
8585
}
8686

@@ -406,7 +406,7 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
406406
// MARK: - Private/Internal
407407

408408
private var config: IterableConfig
409-
private var _apiEndPoint: String
409+
private var apiEndPoint: String
410410

411411
/// Following are needed for handling pending notification and deep link.
412412
static var pendingNotificationResponse: NotificationResponseProtocol?
@@ -576,7 +576,8 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
576576
self.apiKey = apiKey
577577
self.launchOptions = launchOptions
578578
self.config = config
579-
_apiEndPoint = InternalIterableAPI.setApiEndpoint(apiEndPointOverride: apiEndPointOverride, config: config)
579+
apiEndPoint = InternalIterableAPI.setApiEndpoint(apiEndPointOverride: apiEndPointOverride, config: config)
580+
print("api endpoint: " + apiEndPoint)
580581
self.dependencyContainer = dependencyContainer
581582
dateProvider = dependencyContainer.dateProvider
582583
networkSession = dependencyContainer.networkSession

tests/unit-tests/IterableAPITests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class IterableAPITests: XCTestCase {
4646

4747
let internalAPI = InternalIterableAPI.initializeForTesting(apiKey: IterableAPITests.apiKey, config: config)
4848

49-
XCTAssertEqual(internalAPI.apiEndPoint, IterableAPITests.apiEndPointUS)
49+
XCTAssertEqual(internalAPI.apiEndPointForTest, IterableAPITests.apiEndPointUS)
5050
}
5151

5252
func testInitializeWithEUDataRegion() {
@@ -59,7 +59,7 @@ class IterableAPITests: XCTestCase {
5959

6060
let internalAPI = InternalIterableAPI.initializeForTesting(apiKey: IterableAPITests.apiKey, config: config)
6161

62-
XCTAssertEqual(internalAPI.apiEndPoint, IterableAPITests.apiEndPointEU)
62+
XCTAssertEqual(internalAPI.apiEndPointForTest, IterableAPITests.apiEndPointEU)
6363
}
6464

6565
func testInitializeCheckEndpoint() {

0 commit comments

Comments
 (0)