Skip to content

Commit 482eedc

Browse files
author
Evan Greer
committed
fixes merge conflict
2 parents 3e10675 + d9aa189 commit 482eedc

23 files changed

+516
-62
lines changed

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,47 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## 6.4.16
6+
### Added
7+
- `sendRequestWithRetries` function added as part of the `NetworkHelperclass`
8+
- For an API request that results in a 500-level error response, the SDK now executes up to five retries. Before each of the final three attempts, there is a two-second delay.
9+
10+
### Changed
11+
- updates `sendRequest` in `RequestProcessorUtil` to retry the API request that resulted in a 401 response upon receipt of a new JWT
12+
- updates `NetworkHelper` class logic to use `sendRequestWithRetries`method which wraps the original `networkSession.makeRequest`
13+
- When an API request fails with a 401 because of an invalid JWT token, the SDK now immediately requests a new JWT token for the signed-in user.
14+
15+
## 6.4.15
16+
### Added
17+
- This release allows you to use projects hosted on Iterable's EU data center. If your project is hosted on Iterable's [European data center (EUDC)](https://support.iterable.com/hc/articles/17572750887444), configure the SDK to use Iterable's EU-based API endpoints:
18+
19+
_Swift_
20+
21+
```swift
22+
let config = IterableConfig()
23+
config.dataRegion = IterableDataRegion.EU
24+
IterableAPI.initialize(apiKey: "<YOUR_API_KEY>", launchOptions: launchOptions, config: config)
25+
```
26+
27+
_Objective-C_
28+
29+
```objectivec
30+
IterableConfig *config = [[IterableConfig alloc] init];
31+
config.dataRegion = IterableDataRegion.EU;
32+
[IterableAPI initializeWithApiKey:@"<YOUR_API_KEY>" launchOptions:launchOptions config:config];
33+
```
34+
35+
### Fixed
36+
- Offline Mode is now off by default. Offline mode components will only load when the `offlineMode` configuration for RequestHandler is set to true.
37+
38+
### Changed
39+
- Offline mode configuration now persists throughout the current app session. Changes will take effect from the next app session.
40+
41+
## 6.4.14
42+
### Added
43+
- Success and Failure handlers can now be passed to following functions:
44+
`InAppManager.remove`, `InAppManager.setRead`, `IterableAPI.setEmail` and `IterableAPI.setUserId`
45+
546
## 6.4.13
647
### Added
748
- `ITBNotificationServiceExtension` has a new optional delegate in the scenario of wanting to receive and pass along push information (e.g. Firebase)

Iterable-iOS-AppExtensions.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "Iterable-iOS-AppExtensions"
33
s.module_name = "IterableAppExtensions"
4-
s.version = "6.4.13"
4+
s.version = "6.4.16"
55
s.summary = "App Extensions for Iterable SDK"
66

77
s.description = <<-DESC

Iterable-iOS-SDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "Iterable-iOS-SDK"
33
s.module_name = "IterableSDK"
4-
s.version = "6.4.13"
4+
s.version = "6.4.16"
55
s.summary = "Iterable's official SDK for iOS"
66

77
s.description = <<-DESC

swift-sdk.xcodeproj/project.pbxproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,13 @@
185185
5B5AA717284F1A6D0093FED4 /* MockNetworkSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B5AA710284F1A6D0093FED4 /* MockNetworkSession.swift */; };
186186
5B6C3C1127CE871F00B9A753 /* NavInboxSessionUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B6C3C1027CE871F00B9A753 /* NavInboxSessionUITests.swift */; };
187187
5B88BC482805D09D004016E5 /* NetworkSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B88BC472805D09D004016E5 /* NetworkSession.swift */; };
188+
9FF05EAC2AFEA5FA005311F7 /* MockAuthManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FF05EAB2AFEA5FA005311F7 /* MockAuthManager.swift */; };
189+
9FF05EAD2AFEA5FA005311F7 /* MockAuthManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FF05EAB2AFEA5FA005311F7 /* MockAuthManager.swift */; };
190+
9FF05EAE2AFEA5FA005311F7 /* MockAuthManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FF05EAB2AFEA5FA005311F7 /* MockAuthManager.swift */; };
191+
9FF05EAF2AFEA5FA005311F7 /* MockAuthManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FF05EAB2AFEA5FA005311F7 /* MockAuthManager.swift */; };
192+
9FF05EB02AFEA5FA005311F7 /* MockAuthManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FF05EAB2AFEA5FA005311F7 /* MockAuthManager.swift */; };
193+
9FF05EB12AFEA5FA005311F7 /* MockAuthManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FF05EAB2AFEA5FA005311F7 /* MockAuthManager.swift */; };
194+
9FF05EB22AFEA5FA005311F7 /* MockAuthManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FF05EAB2AFEA5FA005311F7 /* MockAuthManager.swift */; };
188195
AC02480822791E2100495FB9 /* IterableInboxNavigationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC02480722791E2100495FB9 /* IterableInboxNavigationViewController.swift */; };
189196
AC02CAA6234E50B5006617E0 /* RegistrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC02CAA5234E50B5006617E0 /* RegistrationTests.swift */; };
190197
AC03094B21E532470003A288 /* InAppPersistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC03094A21E532470003A288 /* InAppPersistence.swift */; };
@@ -594,6 +601,7 @@
594601
5B6C3C1027CE871F00B9A753 /* NavInboxSessionUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavInboxSessionUITests.swift; sourceTree = "<group>"; };
595602
5B88BC472805D09D004016E5 /* NetworkSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkSession.swift; sourceTree = "<group>"; };
596603
5BFC7CED27FC9AF300E77479 /* inbox-ui-tests-app.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "inbox-ui-tests-app.entitlements"; sourceTree = "<group>"; };
604+
9FF05EAB2AFEA5FA005311F7 /* MockAuthManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockAuthManager.swift; sourceTree = "<group>"; };
597605
AC02480722791E2100495FB9 /* IterableInboxNavigationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IterableInboxNavigationViewController.swift; sourceTree = "<group>"; };
598606
AC02CAA5234E50B5006617E0 /* RegistrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegistrationTests.swift; sourceTree = "<group>"; };
599607
AC03094A21E532470003A288 /* InAppPersistence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InAppPersistence.swift; sourceTree = "<group>"; };
@@ -1415,6 +1423,7 @@
14151423
5588DF7D28C04494000697D7 /* MockUrlDelegate.swift */,
14161424
5588DF8D28C044DE000697D7 /* MockUrlOpener.swift */,
14171425
5588DFD528C04683000697D7 /* MockWebView.swift */,
1426+
9FF05EAB2AFEA5FA005311F7 /* MockAuthManager.swift */,
14181427
);
14191428
path = common;
14201429
sourceTree = "<group>";
@@ -2153,6 +2162,7 @@
21532162
ACA2A91A24AB266F001DFD17 /* Mocks.swift in Sources */,
21542163
5588DFAB28C045AE000697D7 /* MockInAppFetcher.swift in Sources */,
21552164
AC29D05C24B5A7E000A9E019 /* CI.swift in Sources */,
2165+
9FF05EB12AFEA5FA005311F7 /* MockAuthManager.swift in Sources */,
21562166
);
21572167
runOnlyForDeploymentPostprocessing = 0;
21582168
};
@@ -2166,6 +2176,7 @@
21662176
AC2C668720D3435700D46CC9 /* ActionRunnerTests.swift in Sources */,
21672177
00CB31B621096129004ACDEC /* TestUtils.swift in Sources */,
21682178
AC89661E2124FBCE0051A6CD /* AutoRegistrationTests.swift in Sources */,
2179+
9FF05EAF2AFEA5FA005311F7 /* MockAuthManager.swift in Sources */,
21692180
ACA8D1A921965B7D001B1332 /* InAppTests.swift in Sources */,
21702181
5588DFB928C045E3000697D7 /* MockInAppDelegate.swift in Sources */,
21712182
5588DFD128C0465E000697D7 /* MockAPNSTypeChecker.swift in Sources */,
@@ -2266,6 +2277,7 @@
22662277
buildActionMask = 2147483647;
22672278
files = (
22682279
5588DFB828C045E3000697D7 /* MockInAppDelegate.swift in Sources */,
2280+
9FF05EAE2AFEA5FA005311F7 /* MockAuthManager.swift in Sources */,
22692281
5588DF7028C0442D000697D7 /* MockDateProvider.swift in Sources */,
22702282
5588DFF028C046FF000697D7 /* MockMessageViewControllerEventTracker.swift in Sources */,
22712283
ACB37AB124026C1E0093A8EA /* SampleInboxViewDelegateImplementations.swift in Sources */,
@@ -2329,6 +2341,7 @@
23292341
ACC6A8502323910D003CC4BE /* UITestsHelper.swift in Sources */,
23302342
5588DFAA28C045AE000697D7 /* MockInAppFetcher.swift in Sources */,
23312343
ACFF4287246569D300FDF10D /* CommonExtensions.swift in Sources */,
2344+
9FF05EB02AFEA5FA005311F7 /* MockAuthManager.swift in Sources */,
23322345
);
23332346
runOnlyForDeploymentPostprocessing = 0;
23342347
};
@@ -2355,6 +2368,7 @@
23552368
5588DFCE28C0465E000697D7 /* MockAPNSTypeChecker.swift in Sources */,
23562369
5588DFDE28C046B7000697D7 /* MockLocalStorage.swift in Sources */,
23572370
ACA8D1A52196309C001B1332 /* Common.swift in Sources */,
2371+
9FF05EAC2AFEA5FA005311F7 /* MockAuthManager.swift in Sources */,
23582372
5588DFB628C045E3000697D7 /* MockInAppDelegate.swift in Sources */,
23592373
5588DF8628C044BE000697D7 /* MockCustomActionDelegate.swift in Sources */,
23602374
AC995F992166EE490099A184 /* CommonMocks.swift in Sources */,
@@ -2393,6 +2407,7 @@
23932407
5588DF7C28C04463000697D7 /* MockNotificationResponse.swift in Sources */,
23942408
5588DFD428C0465E000697D7 /* MockAPNSTypeChecker.swift in Sources */,
23952409
5588DFE428C046B7000697D7 /* MockLocalStorage.swift in Sources */,
2410+
9FF05EB22AFEA5FA005311F7 /* MockAuthManager.swift in Sources */,
23962411
ACC362C924D2CA8C002C67BA /* Common.swift in Sources */,
23972412
ACC362C524D2C190002C67BA /* TaskProcessorTests.swift in Sources */,
23982413
AC2AED4224EBC60C000EE5F3 /* TaskRunnerTests.swift in Sources */,
@@ -2411,6 +2426,7 @@
24112426
5588DFE728C046D7000697D7 /* MockInboxState.swift in Sources */,
24122427
ACFF42A424656CCE00FDF10D /* ViewController.swift in Sources */,
24132428
5588DF7F28C04494000697D7 /* MockUrlDelegate.swift in Sources */,
2429+
9FF05EAD2AFEA5FA005311F7 /* MockAuthManager.swift in Sources */,
24142430
5588DF8728C044BE000697D7 /* MockCustomActionDelegate.swift in Sources */,
24152431
5588DFD728C04683000697D7 /* MockWebView.swift in Sources */,
24162432
5588DFEF28C046FF000697D7 /* MockMessageViewControllerEventTracker.swift in Sources */,

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@
210210
BlueprintName = "offline-events-tests"
211211
ReferencedContainer = "container:swift-sdk.xcodeproj">
212212
</BuildableReference>
213+
<SkippedTests>
214+
<Test
215+
Identifier = "RequestHandlerTests/testFeatureFlagTurnOnOfflineMode()">
216+
</Test>
217+
</SkippedTests>
213218
</TestableReference>
214219
</Testables>
215220
</TestAction>

swift-sdk/Constants.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,11 @@ enum JsonValue {
289289
}
290290
}
291291

292+
public enum IterableDataRegion {
293+
public static let US = "https://api.iterable.com/api/"
294+
public static let EU = "https://api.eu.iterable.com/api/"
295+
}
296+
292297
public protocol JsonValueRepresentable {
293298
var jsonValue: Any { get }
294299
}

swift-sdk/Internal/DependencyContainerProtocol.swift

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,33 @@ extension DependencyContainerProtocol {
7878
networkSession: networkSession,
7979
deviceMetadata: deviceMetadata,
8080
dateProvider: dateProvider)
81-
if let persistenceContextProvider = createPersistenceContextProvider() {
81+
lazy var offlineProcessor: OfflineRequestProcessor? = nil
82+
lazy var healthMonitor: HealthMonitor? = nil
83+
guard let persistenceContextProvider = createPersistenceContextProvider() else {
84+
return RequestHandler(onlineProcessor: onlineProcessor,
85+
offlineProcessor: nil,
86+
healthMonitor: nil,
87+
offlineMode: offlineMode)
88+
}
89+
if offlineMode {
90+
8291
let healthMonitorDataProvider = createHealthMonitorDataProvider(persistenceContextProvider: persistenceContextProvider)
83-
let healthMonitor = HealthMonitor(dataProvider: healthMonitorDataProvider,
84-
dateProvider: dateProvider,
85-
networkSession: networkSession)
86-
let offlineProcessor = OfflineRequestProcessor(apiKey: apiKey,
87-
authProvider: authProvider,
88-
authManager: authManager,
89-
endpoint: endpoint,
90-
deviceMetadata: deviceMetadata,
91-
taskScheduler: createTaskScheduler(persistenceContextProvider: persistenceContextProvider,
92-
healthMonitor: healthMonitor),
93-
taskRunner: createTaskRunner(persistenceContextProvider: persistenceContextProvider,
94-
healthMonitor: healthMonitor),
95-
notificationCenter: notificationCenter)
92+
93+
healthMonitor = HealthMonitor(dataProvider: healthMonitorDataProvider,
94+
dateProvider: dateProvider,
95+
networkSession: networkSession)
96+
offlineProcessor = OfflineRequestProcessor(apiKey: apiKey,
97+
authProvider: authProvider,
98+
authManager: authManager,
99+
endpoint: endpoint,
100+
deviceMetadata: deviceMetadata,
101+
taskScheduler: createTaskScheduler(persistenceContextProvider: persistenceContextProvider,
102+
healthMonitor: healthMonitor!),
103+
taskRunner: createTaskRunner(persistenceContextProvider: persistenceContextProvider,
104+
healthMonitor: healthMonitor!),
105+
notificationCenter: notificationCenter)
106+
107+
96108
return RequestHandler(onlineProcessor: onlineProcessor,
97109
offlineProcessor: offlineProcessor,
98110
healthMonitor: healthMonitor,

swift-sdk/Internal/EmptyInAppManager.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Foundation
66
import UIKit
77

88
class EmptyInAppManager: IterableInternalInAppManagerProtocol {
9+
910
func start() -> Pending<Bool, Error> {
1011
Fulfill<Bool, Error>(value: true)
1112
}
@@ -34,14 +35,24 @@ class EmptyInAppManager: IterableInternalInAppManagerProtocol {
3435

3536
func remove(message _: IterableInAppMessage) {}
3637

38+
func remove(message _: IterableInAppMessage, successHandler _: OnSuccessHandler?, failureHandler _: OnFailureHandler?) {}
39+
3740
func remove(message _: IterableInAppMessage, location _: InAppLocation) {}
3841

42+
func remove(message _: IterableInAppMessage, location _: InAppLocation, successHandler _: OnSuccessHandler?, failureHandler _: OnFailureHandler?) {}
43+
3944
func remove(message _: IterableInAppMessage, location _: InAppLocation, source _: InAppDeleteSource) {}
4045

46+
func remove(message _: IterableInAppMessage, location _: InAppLocation, source _: InAppDeleteSource, successHandler _: OnSuccessHandler?, failureHandler _: OnFailureHandler?) {}
47+
4148
func remove(message _: IterableInAppMessage, location _: InAppLocation, source _: InAppDeleteSource, inboxSessionId _: String?) {}
4249

50+
func remove(message _: IterableInAppMessage, location _: InAppLocation, source _: InAppDeleteSource, inboxSessionId _: String?, successHandler _: OnSuccessHandler?, failureHandler _: OnFailureHandler?) {}
51+
4352
func set(read _: Bool, forMessage _: IterableInAppMessage) {}
4453

54+
func set(read _: Bool, forMessage _: IterableInAppMessage, successHandler _: OnSuccessHandler?, failureHandler _: OnFailureHandler?) {}
55+
4556
func getMessage(withId _: String) -> IterableInAppMessage? {
4657
nil
4758
}

0 commit comments

Comments
 (0)