Skip to content

Commit fd52749

Browse files
Remove offline "beta" mentions from SDK.
1 parent 7c473c8 commit fd52749

9 files changed

+3
-52
lines changed

swift-sdk/Constants.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ enum Const {
5151
static let deviceId = "itbl_device_id"
5252
static let sdkVersion = "itbl_sdk_version"
5353
static let offlineMode = "itbl_offline_mode"
54-
static let offlineModeBeta = "itbl_offline_mode_beta"
5554

5655
static let payloadExpiration = 24
5756
static let attributionInfoExpiration = 24

swift-sdk/Internal/InternalIterableAPI.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
417417
}()
418418

419419
lazy var requestHandler: RequestHandlerProtocol = {
420-
let offlineMode = self.localStorage.isOfflineModeEnabled()
420+
let offlineMode = self.localStorage.offlineMode
421421
return dependencyContainer.createRequestHandler(apiKey: apiKey,
422422
config: config,
423423
endPoint: apiEndPoint,
@@ -636,8 +636,7 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
636636
ITBInfo()
637637
requestHandler.getRemoteConfiguration().onSuccess { remoteConfiguration in
638638
self.localStorage.offlineMode = remoteConfiguration.offlineMode
639-
self.localStorage.offlineModeBeta = remoteConfiguration.offlineModeBeta
640-
self.requestHandler.offlineMode = remoteConfiguration.isOfflineModeEnabled()
639+
self.requestHandler.offlineMode = remoteConfiguration.offlineMode
641640
ITBInfo("setting offlineMode: \(self.requestHandler.offlineMode)")
642641
}.onError { error in
643642
let offlineMode = self.requestHandler.offlineMode

swift-sdk/Internal/IterableUserDefaults.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,6 @@ class IterableUserDefaults {
6666
}
6767
}
6868

69-
var offlineModeBeta: Bool {
70-
get {
71-
return bool(withKey: .offlineModeBeta)
72-
}
73-
set {
74-
save(bool: newValue, withKey: .offlineModeBeta)
75-
}
76-
}
77-
7869
func getAttributionInfo(currentDate: Date) -> IterableAttributionInfo? {
7970
(try? codable(withKey: .attributionInfo, currentDate: currentDate)) ?? nil
8071
}
@@ -204,7 +195,6 @@ class IterableUserDefaults {
204195
static let deviceId = UserDefaultsKey(value: Const.UserDefault.deviceId)
205196
static let sdkVersion = UserDefaultsKey(value: Const.UserDefault.sdkVersion)
206197
static let offlineMode = UserDefaultsKey(value: Const.UserDefault.offlineMode)
207-
static let offlineModeBeta = UserDefaultsKey(value: Const.UserDefault.offlineModeBeta)
208198
}
209199

210200
private struct Envelope: Codable {

swift-sdk/Internal/LocalStorage.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,6 @@ struct LocalStorage: LocalStorageProtocol {
6767
}
6868
}
6969

70-
var offlineModeBeta: Bool {
71-
get {
72-
iterableUserDefaults.offlineModeBeta
73-
}
74-
set {
75-
iterableUserDefaults.offlineModeBeta = newValue
76-
}
77-
}
78-
7970
func getAttributionInfo(currentDate: Date) -> IterableAttributionInfo? {
8071
iterableUserDefaults.getAttributionInfo(currentDate: currentDate)
8172
}

swift-sdk/Internal/LocalStorageProtocol.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ protocol LocalStorageProtocol {
1212
var deviceId: String? { get set }
1313
var sdkVersion: String? { get set }
1414
var offlineMode: Bool { get set }
15-
var offlineModeBeta: Bool { get set }
1615
func getAttributionInfo(currentDate: Date) -> IterableAttributionInfo?
1716
func save(attributionInfo: IterableAttributionInfo?, withExpiration expiration: Date?)
1817
func getPayload(currentDate: Date) -> [AnyHashable: Any]?
@@ -21,10 +20,6 @@ protocol LocalStorageProtocol {
2120
}
2221

2322
extension LocalStorageProtocol {
24-
func isOfflineModeEnabled() -> Bool {
25-
RemoteConfiguration.isBeta ? offlineModeBeta : offlineMode
26-
}
27-
2823
func upgrade() {
2924
}
3025
}

swift-sdk/Internal/Models.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,5 @@
66
import Foundation
77

88
struct RemoteConfiguration: Codable, Equatable {
9-
static let isBeta = false
10-
119
let offlineMode: Bool
12-
let offlineModeBeta: Bool
13-
14-
func isOfflineModeEnabled() -> Bool {
15-
Self.isBeta ? offlineModeBeta : offlineMode
16-
}
17-
1810
}

tests/common/CommonMocks.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,6 @@ class MockLocalStorage: LocalStorageProtocol {
434434

435435
var offlineMode: Bool = false
436436

437-
var offlineModeBeta: Bool = false
438-
439437
func getAttributionInfo(currentDate: Date) -> IterableAttributionInfo? {
440438
guard !MockLocalStorage.isExpired(expiration: attributionInfoExpiration, currentDate: currentDate) else {
441439
return nil

tests/offline-events-tests/RequestHandlerTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ class RequestHandlerTests: XCTestCase {
688688

689689
func testGetRemoteConfiguration() throws {
690690
let expectation1 = expectation(description: #function)
691-
let expectedRemoteConfiguration = RemoteConfiguration(offlineMode: true, offlineModeBeta: true)
691+
let expectedRemoteConfiguration = RemoteConfiguration(offlineMode: true)
692692
let data = try JSONEncoder().encode(expectedRemoteConfiguration)
693693
let notificationCenter = MockNotificationCenter()
694694
let networkSession = MockNetworkSession(statusCode: 200, data: data)

tests/unit-tests/LocalStorageTests.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -169,19 +169,6 @@ class LocalStorageTests: XCTestCase {
169169
testLocalStorage(saver: saver, retriever: retriever, value: false)
170170
}
171171

172-
func testOfflineModeBeta() {
173-
let saver = { (storage: LocalStorageProtocol, value: Bool) -> Void in
174-
var localStorage = storage
175-
localStorage.offlineModeBeta = value
176-
}
177-
let retriever = { (storage: LocalStorageProtocol) -> Bool? in
178-
storage.offlineModeBeta
179-
}
180-
181-
testLocalStorage(saver: saver, retriever: retriever, value: true)
182-
testLocalStorage(saver: saver, retriever: retriever, value: false)
183-
}
184-
185172
private func testLocalStorage<T>(saver: (LocalStorageProtocol, T) -> Void,
186173
retriever: (LocalStorageProtocol) -> T?, value: T) where T: Equatable {
187174
let localStorage = LocalStorage(userDefaults: LocalStorageTests.getTestUserDefaults())

0 commit comments

Comments
 (0)