Skip to content

Commit d0e0390

Browse files
committed
Merge branch 'master' into jay/MOB-4239-updateEmail-withToken
2 parents 4cbb35c + 5f061a9 commit d0e0390

18 files changed

+94
-241
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/ApiClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class ApiClient {
8282
return .failure(IterableError.general(description: "authProvider is missing"))
8383
}
8484

85-
return .success(RequestCreator(apiKey: apiKey, auth: authProvider.auth, deviceMetadata: deviceMetadata))
85+
return .success(RequestCreator(auth: authProvider.auth, deviceMetadata: deviceMetadata))
8686
}
8787

8888
private let apiKey: String

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
@@ -397,7 +397,7 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
397397
private var networkSession: NetworkSessionProtocol
398398
private var urlOpener: UrlOpenerProtocol
399399

400-
private var deepLinkManager: IterableDeepLinkManager
400+
private var deepLinkManager: DeepLinkManager
401401

402402
private var _email: String?
403403
private var _userId: String?
@@ -547,7 +547,7 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
547547
localStorage = dependencyContainer.localStorage
548548
inAppDisplayer = dependencyContainer.inAppDisplayer
549549
urlOpener = dependencyContainer.urlOpener
550-
deepLinkManager = IterableDeepLinkManager(redirectNetworkSessionProvider: dependencyContainer)
550+
deepLinkManager = DeepLinkManager(redirectNetworkSessionProvider: dependencyContainer)
551551
}
552552

553553
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),

swift-sdk/Internal/OfflineRequestProcessor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ struct OfflineRequestProcessor: RequestProcessorProtocol {
246246
private let taskRunner: IterableTaskRunner
247247

248248
private func createRequestCreator(authProvider: AuthProvider) -> RequestCreator {
249-
return RequestCreator(apiKey: apiKey, auth: authProvider.auth, deviceMetadata: deviceMetadata)
249+
return RequestCreator(auth: authProvider.auth, deviceMetadata: deviceMetadata)
250250
}
251251

252252
private func sendIterableRequest(requestGenerator: (RequestCreator) -> Result<IterableRequest, IterableError>,

swift-sdk/Internal/RequestCreator.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import UIKit
99
/// This will create IterableRequest
1010
/// The API Endpoint and request endpoint is not defined yet
1111
struct RequestCreator {
12-
let apiKey: String
1312
let auth: Auth
1413
let deviceMetadata: DeviceMetadata
1514

@@ -449,7 +448,7 @@ struct RequestCreator {
449448

450449
private func createPostRequest(path: String, body: [AnyHashable: Any]? = nil) -> PostRequest {
451450
PostRequest(path: path,
452-
args: [JsonKey.Header.apiKey: apiKey],
451+
args: nil,
453452
body: body)
454453
}
455454

0 commit comments

Comments
 (0)