Skip to content

Commit c4a282e

Browse files
New release. Fix inApp messages.
1 parent a50b14f commit c4a282e

File tree

6 files changed

+42
-11
lines changed

6 files changed

+42
-11
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1515
#### Fixed
1616
- nothing yet
1717

18+
## [6.0.2](https://github.com/Iterable/swift-sdk/releases/tag/6.0.1)
19+
#### Added
20+
- You can now set `logHandler` in IterableConfig.
21+
- Now you don't have to call `IterableAPI.registerToken` on login/logout.
22+
23+
24+
#### Fixed
25+
- Don't show in-app message if one is already showing.
26+
27+
1828
## [6.0.1](https://github.com/Iterable/swift-sdk/releases/tag/6.0.1)
1929

2030
#### Fixed

Iterable-iOS-AppExtensions.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
1717

1818
s.name = "Iterable-iOS-AppExtensions"
1919
s.module_name = "IterableAppExtensions"
20-
s.version = "6.0.1"
20+
s.version = "6.0.2"
2121
s.summary = "App Extensions for Iterable SDK"
2222

2323
s.description = <<-DESC

Iterable-iOS-SDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
1717

1818
s.name = "Iterable-iOS-SDK"
1919
s.module_name = "IterableSDK"
20-
s.version = "6.0.1"
20+
s.version = "6.0.2"
2121
s.summary = "Iterable's official SDK for iOS"
2222

2323
s.description = <<-DESC

Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
platform :ios, '8.0'
1+
platform :ios, '9.0'
22

33
target 'swift-sdk-swift-tests' do
44
pod 'OHHTTPStubs/Swift'

Tests/swift-sdk-swift-tests/IterableAPITests.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,4 +371,28 @@ class IterableAPITests: XCTestCase {
371371

372372
wait(for: [expectation], timeout: testExpectationTimeout)
373373
}
374+
375+
func testGetInAppMessages() {
376+
let expectation1 = expectation(description: "get in app messages")
377+
let networkSession = MockNetworkSession(statusCode: 200)
378+
networkSession.callback = {(_,_,_) in
379+
let expectedQueryParams = [
380+
(name: AnyHashable.ITBL_KEY_API_KEY, value: IterableAPITests.apiKey),
381+
(name: AnyHashable.ITBL_KEY_COUNT, value: 1.description),
382+
(name: AnyHashable.ITBL_KEY_PLATFORM, value: .ITBL_PLATFORM_IOS),
383+
(name: AnyHashable.ITBL_KEY_SDK_VERSION, value: IterableAPI.sdkVersion),
384+
]
385+
TestUtils.validate(request: networkSession.request!,
386+
requestType: .get,
387+
apiEndPoint: .ITBL_ENDPOINT_API,
388+
path: .ITBL_PATH_GET_INAPP_MESSAGES,
389+
queryParams: expectedQueryParams)
390+
expectation1.fulfill()
391+
}
392+
let config = IterableConfig()
393+
IterableAPI.initialize(apiKey: IterableAPITests.apiKey, config:config, networkSession: networkSession)
394+
IterableAPI.email = "[email protected]"
395+
IterableAPI.get(inAppMessages: 1)
396+
wait(for: [expectation1], timeout: testExpectationTimeout)
397+
}
374398
}

swift-sdk/Internal/IterableAPIInternal.swift

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -427,14 +427,15 @@ final class IterableAPIInternal : NSObject, PushTrackerProtocol {
427427
return
428428
}
429429

430-
var args : [String : String] = [
430+
var args : [AnyHashable : Any] = [
431431
AnyHashable.ITBL_KEY_COUNT: count.description,
432-
AnyHashable.ITBL_KEY_PLATFORM: .ITBL_PLATFORM_IOS,
432+
AnyHashable.ITBL_KEY_PLATFORM: String.ITBL_PLATFORM_IOS,
433433
AnyHashable.ITBL_KEY_SDK_VERSION: IterableAPI.sdkVersion
434434
]
435+
435436
addEmailOrUserId(args: &args)
436-
437-
if let request = createGetRequest(forPath: .ITBL_PATH_GET_INAPP_MESSAGES, withArgs: args) {
437+
438+
if let request = createGetRequest(forPath: .ITBL_PATH_GET_INAPP_MESSAGES, withArgs: args as! [String : String]) {
438439
sendRequest(request, onSuccess: onSuccess, onFailure: onFailure)
439440
}
440441
}
@@ -681,10 +682,6 @@ final class IterableAPIInternal : NSObject, PushTrackerProtocol {
681682
}
682683
}
683684

684-
private func addEmailOrUserId(args: inout [String : String], mustExist: Bool = true) {
685-
addEmailOrUserId(args: &args, mustExist: mustExist)
686-
}
687-
688685
// MARK: Initialization
689686
// Package private method. Do not call this directly.
690687
init(apiKey: String,

0 commit comments

Comments
 (0)