Skip to content

Commit e179438

Browse files
committed
rename + add authToken to IterableAPICallRequest
1 parent fe72db1 commit e179438

File tree

6 files changed

+63
-58
lines changed

6 files changed

+63
-58
lines changed

swift-sdk/Internal/ApiClient.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class ApiClient {
3636
let apiCallRequest = IterableAPICallRequest(apiKey: apiKey,
3737
endPoint: endPoint,
3838
auth: authProvider.auth,
39+
authToken: authProvider.auth.authToken,
3940
deviceMetadata: deviceMetadata,
4041
iterableRequest: iterableRequest).addingCreatedAt(currentDate)
4142
return apiCallRequest.convertToURLRequest(sentAt: currentDate)

swift-sdk/Internal/InboxState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class InboxState: InboxStateProtocol {
7171
inboxSessionId: inboxSessionId)
7272
}
7373

74-
init(internalAPIProvider: @escaping @autoclosure () -> InternalIterableAPI? = IterableAPI.internalImplementation) {
74+
init(internalAPIProvider: @escaping @autoclosure () -> InternalIterableAPI? = IterableAPI.implementation) {
7575
self.internalAPIProvider = internalAPIProvider
7676
}
7777

swift-sdk/Internal/InternalIterableAPI.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import UIKit
77

88
final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
99
var apiKey: String
10+
1011
var lastPushPayload: [AnyHashable: Any]? {
1112
get {
1213
_payloadData

swift-sdk/Internal/IterableAPICallRequest.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ struct IterableAPICallRequest {
1010
let apiKey: String
1111
let endPoint: String
1212
let auth: Auth
13+
let authToken: String?
1314
let deviceMetadata: DeviceMetadata
1415
let iterableRequest: IterableRequest
1516

@@ -54,6 +55,7 @@ struct IterableAPICallRequest {
5455
IterableAPICallRequest(apiKey: apiKey,
5556
endPoint: endPoint,
5657
auth: auth,
58+
authToken: authToken,
5759
deviceMetadata: deviceMetadata,
5860
iterableRequest: iterableRequest.addingBodyField(key: key, value: value))
5961
}

swift-sdk/Internal/OfflineRequestProcessor.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ struct OfflineRequestProcessor: RequestProcessorProtocol {
265265
let apiCallRequest = IterableAPICallRequest(apiKey: apiKey,
266266
endPoint: endPoint,
267267
auth: authProvider.auth,
268+
authToken: authManager?.getAuthToken(),
268269
deviceMetadata: deviceMetadata,
269270
iterableRequest: iterableRequest)
270271

0 commit comments

Comments
 (0)