Skip to content

Commit 5f061a9

Browse files
authored
Merge pull request #546 from Iterable/jay/MOB-4284-maintenance
[MOB-4284] maintenance
2 parents 0e990f5 + 058ed99 commit 5f061a9

11 files changed

+81
-221
lines changed

swift-sdk.xcodeproj/project.pbxproj

Lines changed: 53 additions & 37 deletions
Large diffs are not rendered by default.

swift-sdk.xcodeproj/xcshareddata/xcschemes/ios9-tests.xcscheme

Lines changed: 0 additions & 157 deletions
This file was deleted.

swift-sdk/Internal/IterableActionRunner.swift renamed to swift-sdk/Internal/ActionRunner.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class AppUrlOpener: UrlOpenerProtocol {
2020
}
2121
}
2222

23-
struct IterableActionRunner {
23+
struct ActionRunner {
2424
// returns true if an action is performed either by us or by the calling app.
2525
@discardableResult
2626
static func execute(action: IterableAction,

swift-sdk/Internal/IterableDeepLinkManager.swift renamed to swift-sdk/Internal/DeepLinkManager.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
import Foundation
66

7-
class IterableDeepLinkManager: NSObject {
7+
class DeepLinkManager: NSObject {
88
init(redirectNetworkSessionProvider: RedirectNetworkSessionProvider) {
99
self.redirectNetworkSessionProvider = redirectNetworkSessionProvider
1010
}
11+
1112
/// Handles a Universal Link
1213
/// For Iterable links, it will track the click and retrieve the original URL,
1314
/// pass it to `IterableURLDelegate` for handling
@@ -28,7 +29,7 @@ class IterableDeepLinkManager: NSObject {
2829
if let action = IterableAction.actionOpenUrl(fromUrlString: resolvedUrlString) {
2930
let context = IterableActionContext(action: action, source: .universalLink)
3031

31-
IterableActionRunner.execute(action: action,
32+
ActionRunner.execute(action: action,
3233
context: context,
3334
urlHandler: IterableUtil.urlHandler(fromUrlDelegate: urlDelegate,
3435
inContext: context),
@@ -45,7 +46,7 @@ class IterableDeepLinkManager: NSObject {
4546
if let action = IterableAction.actionOpenUrl(fromUrlString: url.absoluteString) {
4647
let context = IterableActionContext(action: action, source: .universalLink)
4748

48-
IterableActionRunner.execute(action: action,
49+
ActionRunner.execute(action: action,
4950
context: context,
5051
urlHandler: IterableUtil.urlHandler(fromUrlDelegate: urlDelegate,
5152
inContext: context),
@@ -107,7 +108,7 @@ class IterableDeepLinkManager: NSObject {
107108
private var deepLinkMessageId: String?
108109
}
109110

110-
extension IterableDeepLinkManager: RedirectNetworkSessionDelegate {
111+
extension DeepLinkManager: RedirectNetworkSessionDelegate {
111112
func onRedirect(deepLinkLocation: URL?, campaignId: NSNumber?, templateId: NSNumber?, messageId: String?) {
112113
self.deepLinkLocation = deepLinkLocation
113114
self.deepLinkCampaignId = campaignId

swift-sdk/Internal/InAppManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ class InAppManager: NSObject, IterableInternalInAppManagerProtocol {
433433

434434
let context = IterableActionContext(action: action, source: .inApp)
435435
DispatchQueue.main.async { [weak self] in
436-
IterableActionRunner.execute(action: action,
436+
ActionRunner.execute(action: action,
437437
context: context,
438438
urlHandler: IterableUtil.urlHandler(fromUrlDelegate: self?.urlDelegate, inContext: context),
439439
customActionHandler: IterableUtil.customActionHandler(fromCustomActionDelegate: self?.customActionDelegate, inContext: context),

swift-sdk/Internal/InternalIterableAPI.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
394394
private var networkSession: NetworkSessionProtocol
395395
private var urlOpener: UrlOpenerProtocol
396396

397-
private var deepLinkManager: IterableDeepLinkManager
397+
private var deepLinkManager: DeepLinkManager
398398

399399
private var _email: String?
400400
private var _userId: String?
@@ -541,7 +541,7 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
541541
localStorage = dependencyContainer.localStorage
542542
inAppDisplayer = dependencyContainer.inAppDisplayer
543543
urlOpener = dependencyContainer.urlOpener
544-
deepLinkManager = IterableDeepLinkManager(redirectNetworkSessionProvider: dependencyContainer)
544+
deepLinkManager = DeepLinkManager(redirectNetworkSessionProvider: dependencyContainer)
545545
}
546546

547547
func start() -> Pending<Bool, Error> {

swift-sdk/Internal/InternalIterableAppIntegration.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ struct InternalIterableAppIntegration {
194194
// Execute the action
195195
if let action = action {
196196
let context = IterableActionContext(action: action, source: .push)
197-
IterableActionRunner.execute(action: action,
197+
ActionRunner.execute(action: action,
198198
context: context,
199199
urlHandler: IterableUtil.urlHandler(fromUrlDelegate: urlDelegate, inContext: context),
200200
customActionHandler: IterableUtil.customActionHandler(fromCustomActionDelegate: customActionDelegate, inContext: context),
@@ -289,7 +289,7 @@ struct InternalIterableAppIntegration {
289289
if let action = InternalIterableAppIntegration.createDefaultAction(userInfo: userInfo, iterableElement: itbl) {
290290
let context = IterableActionContext(action: action, source: .push)
291291

292-
IterableActionRunner.execute(action: action,
292+
ActionRunner.execute(action: action,
293293
context: context,
294294
urlHandler: IterableUtil.urlHandler(fromUrlDelegate: urlDelegate, inContext: context),
295295
customActionHandler: IterableUtil.customActionHandler(fromCustomActionDelegate: customActionDelegate, inContext: context),

tests/unit-tests/IterableActionRunnerTests.swift renamed to tests/unit-tests/ActionRunnerTests.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import XCTest
99
let testExpectationTimeout = 15.0 // How long to wait when we expect to succeed
1010
let testExpectationTimeoutForInverted = 1.0 // How long to wait when we expect to fail
1111

12-
class IterableActionRunnerTests: XCTestCase {
12+
class ActionRunnerTests: XCTestCase {
1313
func testUrlOpenAction() {
1414
validateUrlOpenAction(source: .push)
1515
validateUrlOpenAction(source: .inApp)
@@ -28,7 +28,7 @@ class IterableActionRunnerTests: XCTestCase {
2828
return true
2929
}
3030

31-
let handled = IterableActionRunner.execute(action: action,
31+
let handled = ActionRunner.execute(action: action,
3232
context: context,
3333
urlHandler: urlHandler,
3434
urlOpener: urlOpener)
@@ -50,7 +50,7 @@ class IterableActionRunnerTests: XCTestCase {
5050
return true
5151
}
5252

53-
let handled = IterableActionRunner.execute(action: action,
53+
let handled = ActionRunner.execute(action: action,
5454
context: context,
5555
customActionHandler: customActionHandler)
5656

@@ -69,7 +69,7 @@ class IterableActionRunnerTests: XCTestCase {
6969
return false
7070
}
7171

72-
let handled = IterableActionRunner.execute(action: action,
72+
let handled = ActionRunner.execute(action: action,
7373
context: context,
7474
customActionHandler: customActionHandler)
7575

@@ -94,7 +94,7 @@ class IterableActionRunnerTests: XCTestCase {
9494
expectation1.fulfill()
9595
}
9696

97-
let handled = IterableActionRunner.execute(action: action,
97+
let handled = ActionRunner.execute(action: action,
9898
context: context,
9999
urlHandler: nil,
100100
urlOpener: urlOpener)
@@ -115,7 +115,7 @@ class IterableActionRunnerTests: XCTestCase {
115115
expectation1.fulfill()
116116
}
117117

118-
IterableActionRunner.execute(action: action,
118+
ActionRunner.execute(action: action,
119119
context: context,
120120
urlHandler: nil,
121121
urlOpener: urlOpener)
@@ -134,7 +134,7 @@ class IterableActionRunnerTests: XCTestCase {
134134
expectation1.fulfill()
135135
}
136136

137-
IterableActionRunner.execute(action: action,
137+
ActionRunner.execute(action: action,
138138
context: context,
139139
urlHandler: nil,
140140
urlOpener: urlOpener,
@@ -155,7 +155,7 @@ class IterableActionRunnerTests: XCTestCase {
155155
return false
156156
}
157157

158-
let handled = IterableActionRunner.execute(action: action,
158+
let handled = ActionRunner.execute(action: action,
159159
context: context,
160160
urlHandler: urlHandler,
161161
urlOpener: urlOpener)

tests/unit-tests/IterableAutoRegistrationTests.swift renamed to tests/unit-tests/AutoRegistrationTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import XCTest
66

77
@testable import IterableSDK
88

9-
class IterableAutoRegistrationTests: XCTestCase {
9+
class AutoRegistrationTests: XCTestCase {
1010
private static let apiKey = "zeeApiKey"
1111

1212
override func setUp() {
@@ -53,7 +53,7 @@ class IterableAutoRegistrationTests: XCTestCase {
5353

5454
let notificationStateProvider = MockNotificationStateProvider(enabled: false, expectation: expectation2)
5555

56-
let internalAPI = InternalIterableAPI.initializeForTesting(apiKey: IterableAutoRegistrationTests.apiKey,
56+
let internalAPI = InternalIterableAPI.initializeForTesting(apiKey: AutoRegistrationTests.apiKey,
5757
config: config,
5858
networkSession: networkSession,
5959
notificationStateProvider: notificationStateProvider)
@@ -94,7 +94,7 @@ class IterableAutoRegistrationTests: XCTestCase {
9494
// notifications are enabled
9595
let notificationStateProvider = MockNotificationStateProvider(enabled: true, expectation: expectation1)
9696

97-
let internalAPI = InternalIterableAPI.initializeForTesting(apiKey: IterableAutoRegistrationTests.apiKey,
97+
let internalAPI = InternalIterableAPI.initializeForTesting(apiKey: AutoRegistrationTests.apiKey,
9898
config: config, networkSession: networkSession,
9999
notificationStateProvider: notificationStateProvider)
100100
let email = "[email protected]"
@@ -136,7 +136,7 @@ class IterableAutoRegistrationTests: XCTestCase {
136136
config.autoPushRegistration = false
137137
let notificationStateProvider = MockNotificationStateProvider(enabled: true, expectation: expectation1)
138138

139-
let internalAPI = InternalIterableAPI.initializeForTesting(apiKey: IterableAutoRegistrationTests.apiKey,
139+
let internalAPI = InternalIterableAPI.initializeForTesting(apiKey: AutoRegistrationTests.apiKey,
140140
config: config,
141141
networkSession: networkSession,
142142
notificationStateProvider: notificationStateProvider)
@@ -159,7 +159,7 @@ class IterableAutoRegistrationTests: XCTestCase {
159159

160160
let localStorage = MockLocalStorage()
161161
localStorage.email = "[email protected]"
162-
InternalIterableAPI.initializeForTesting(apiKey: IterableAutoRegistrationTests.apiKey,
162+
InternalIterableAPI.initializeForTesting(apiKey: AutoRegistrationTests.apiKey,
163163
config: config,
164164
networkSession: networkSession,
165165
notificationStateProvider: notificationStateProvider,

tests/unit-tests/DeepLinkTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class DeepLinkTests: XCTestCase {
4242
campaignId: campaignId,
4343
templateId: templateId,
4444
messageId: messageId)
45-
let deepLinkManager = IterableDeepLinkManager(redirectNetworkSessionProvider: networkSessionProvider)
45+
let deepLinkManager = DeepLinkManager(redirectNetworkSessionProvider: networkSessionProvider)
4646

4747
let (isIterableLink, attributionInfoFuture) = deepLinkManager.handleUniversalLink(URL(string: iterableRewriteURL)!,
4848
urlDelegate: mockUrlDelegate,
@@ -68,7 +68,7 @@ class DeepLinkTests: XCTestCase {
6868
expectation1.fulfill()
6969
}
7070

71-
let deepLinkManager = IterableDeepLinkManager(redirectNetworkSessionProvider: createNoRedirectNetworkSessionProvider())
71+
let deepLinkManager = DeepLinkManager(redirectNetworkSessionProvider: createNoRedirectNetworkSessionProvider())
7272

7373
let (isIterableLink, _) = deepLinkManager.handleUniversalLink(URL(string: iterableNoRewriteURL)!,
7474
urlDelegate: mockUrlDelegate,
@@ -145,7 +145,7 @@ class DeepLinkTests: XCTestCase {
145145
expectation1.fulfill()
146146
}
147147

148-
let deepLinkManager = IterableDeepLinkManager(redirectNetworkSessionProvider: createNoRedirectNetworkSessionProvider())
148+
let deepLinkManager = DeepLinkManager(redirectNetworkSessionProvider: createNoRedirectNetworkSessionProvider())
149149

150150
_ = deepLinkManager.handleUniversalLink(URL(string: redirectRequest)!,
151151
urlDelegate: mockUrlDelegate,

0 commit comments

Comments
 (0)