Skip to content

Commit

Permalink
Merge pull request #25 from Iterable/release-6.0.2
Browse files Browse the repository at this point in the history
release-6.0.2
  • Loading branch information
tapashmajumder committed Sep 19, 2018
2 parents a50b14f + c4a282e commit 023d1a9
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 11 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Expand Up @@ -15,6 +15,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
#### Fixed
- nothing yet

## [6.0.2](https://github.com/Iterable/swift-sdk/releases/tag/6.0.1)
#### Added
- You can now set `logHandler` in IterableConfig.
- Now you don't have to call `IterableAPI.registerToken` on login/logout.


#### Fixed
- Don't show in-app message if one is already showing.


## [6.0.1](https://github.com/Iterable/swift-sdk/releases/tag/6.0.1)

#### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Iterable-iOS-AppExtensions.podspec
Expand Up @@ -17,7 +17,7 @@ Pod::Spec.new do |s|

s.name = "Iterable-iOS-AppExtensions"
s.module_name = "IterableAppExtensions"
s.version = "6.0.1"
s.version = "6.0.2"
s.summary = "App Extensions for Iterable SDK"

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion Iterable-iOS-SDK.podspec
Expand Up @@ -17,7 +17,7 @@ Pod::Spec.new do |s|

s.name = "Iterable-iOS-SDK"
s.module_name = "IterableSDK"
s.version = "6.0.1"
s.version = "6.0.2"
s.summary = "Iterable's official SDK for iOS"

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion Podfile
@@ -1,4 +1,4 @@
platform :ios, '8.0'
platform :ios, '9.0'

target 'swift-sdk-swift-tests' do
pod 'OHHTTPStubs/Swift'
Expand Down
24 changes: 24 additions & 0 deletions Tests/swift-sdk-swift-tests/IterableAPITests.swift
Expand Up @@ -371,4 +371,28 @@ class IterableAPITests: XCTestCase {

wait(for: [expectation], timeout: testExpectationTimeout)
}

func testGetInAppMessages() {
let expectation1 = expectation(description: "get in app messages")
let networkSession = MockNetworkSession(statusCode: 200)
networkSession.callback = {(_,_,_) in
let expectedQueryParams = [
(name: AnyHashable.ITBL_KEY_API_KEY, value: IterableAPITests.apiKey),
(name: AnyHashable.ITBL_KEY_COUNT, value: 1.description),
(name: AnyHashable.ITBL_KEY_PLATFORM, value: .ITBL_PLATFORM_IOS),
(name: AnyHashable.ITBL_KEY_SDK_VERSION, value: IterableAPI.sdkVersion),
]
TestUtils.validate(request: networkSession.request!,
requestType: .get,
apiEndPoint: .ITBL_ENDPOINT_API,
path: .ITBL_PATH_GET_INAPP_MESSAGES,
queryParams: expectedQueryParams)
expectation1.fulfill()
}
let config = IterableConfig()
IterableAPI.initialize(apiKey: IterableAPITests.apiKey, config:config, networkSession: networkSession)
IterableAPI.email = "user@example.com"
IterableAPI.get(inAppMessages: 1)
wait(for: [expectation1], timeout: testExpectationTimeout)
}
}
13 changes: 5 additions & 8 deletions swift-sdk/Internal/IterableAPIInternal.swift
Expand Up @@ -427,14 +427,15 @@ final class IterableAPIInternal : NSObject, PushTrackerProtocol {
return
}

var args : [String : String] = [
var args : [AnyHashable : Any] = [
AnyHashable.ITBL_KEY_COUNT: count.description,
AnyHashable.ITBL_KEY_PLATFORM: .ITBL_PLATFORM_IOS,
AnyHashable.ITBL_KEY_PLATFORM: String.ITBL_PLATFORM_IOS,
AnyHashable.ITBL_KEY_SDK_VERSION: IterableAPI.sdkVersion
]

addEmailOrUserId(args: &args)
if let request = createGetRequest(forPath: .ITBL_PATH_GET_INAPP_MESSAGES, withArgs: args) {

if let request = createGetRequest(forPath: .ITBL_PATH_GET_INAPP_MESSAGES, withArgs: args as! [String : String]) {
sendRequest(request, onSuccess: onSuccess, onFailure: onFailure)
}
}
Expand Down Expand Up @@ -681,10 +682,6 @@ final class IterableAPIInternal : NSObject, PushTrackerProtocol {
}
}

private func addEmailOrUserId(args: inout [String : String], mustExist: Bool = true) {
addEmailOrUserId(args: &args, mustExist: mustExist)
}

// MARK: Initialization
// Package private method. Do not call this directly.
init(apiKey: String,
Expand Down

0 comments on commit 023d1a9

Please sign in to comment.