Skip to content

Commit

Permalink
Merge pull request #387 from Iterable/feature/mob-2125-xcode12
Browse files Browse the repository at this point in the history
[MOB-2125] - iOS 14 warnings fix
  • Loading branch information
tapashmajumder committed Sep 23, 2020
2 parents 71230ac + 5a0929b commit e2f23c3
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 55 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build-and-test.yml
Expand Up @@ -8,9 +8,14 @@ jobs:

steps:
- uses: actions/checkout@v2

- uses: maxim-lobanov/setup-xcode@v1.1
with:
xcode-version: 12.0

- name: Build and test
run: |
xcodebuild test -project swift-sdk.xcodeproj -scheme swift-sdk -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11' -enableCodeCoverage YES CODE_SIGNING_REQUIRED=NO | xcpretty || exit 1
xcodebuild test -project swift-sdk.xcodeproj -scheme swift-sdk -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11' -enableCodeCoverage YES CODE_SIGNING_REQUIRED=NO | xcpretty && exit ${PIPESTATUS[0]}
- name: CocoaPods lint
run: pod lib lint
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,13 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## 6.2.11
#### Added
- Xcode 12 and iOS 14 support.

#### Fixed
- Fixed minor warnings.

## 6.2.10
#### Added
- An option to pause automatic in-app displaying has been added. To pause, set `IterableAPI.inAppManager.isAutoDisplayPaused` to `true` (default: `false`).
Expand Down
2 changes: 1 addition & 1 deletion Iterable-iOS-AppExtensions.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "Iterable-iOS-AppExtensions"
s.module_name = "IterableAppExtensions"
s.version = "6.2.10"
s.version = "6.2.11"
s.summary = "App Extensions for Iterable SDK"

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion Iterable-iOS-SDK.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "Iterable-iOS-SDK"
s.module_name = "IterableSDK"
s.version = "6.2.10"
s.version = "6.2.11"
s.summary = "Iterable's official SDK for iOS"

s.description = <<-DESC
Expand Down
32 changes: 17 additions & 15 deletions swift-sdk.xcodeproj/project.pbxproj
Expand Up @@ -1164,7 +1164,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1030;
LastUpgradeCheck = 0940;
LastUpgradeCheck = 1200;
ORGANIZATIONNAME = Iterable;
TargetAttributes = {
AC2263DE20CF49B8009800EB = {
Expand Down Expand Up @@ -1770,6 +1770,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -1796,7 +1797,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = IterableSDK;
Expand Down Expand Up @@ -1835,6 +1836,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -1856,7 +1858,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = IterableSDK;
SDKROOT = iphoneos;
Expand All @@ -1881,7 +1883,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "swift-sdk/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1911,7 +1913,7 @@
ENABLE_TESTABILITY = YES;
INFOPLIST_FILE = "swift-sdk/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -1933,7 +1935,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = BP98Z28R86;
INFOPLIST_FILE = "Tests/swift-sdk-swift-tests/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -1952,7 +1954,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = BP98Z28R86;
INFOPLIST_FILE = "Tests/swift-sdk-swift-tests/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1980,7 +1982,7 @@
ENABLE_TESTABILITY = YES;
INFOPLIST_FILE = "notification-extension/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -2011,7 +2013,7 @@
ENABLE_TESTABILITY = YES;
INFOPLIST_FILE = "notification-extension/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -2034,7 +2036,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = BP98Z28R86;
INFOPLIST_FILE = "Tests/notification-extension-tests/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -2057,7 +2059,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = BP98Z28R86;
INFOPLIST_FILE = "Tests/notification-extension-tests/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -2210,7 +2212,7 @@
DEVELOPMENT_TEAM = BP98Z28R86;
ENABLE_TESTABILITY = YES;
INFOPLIST_FILE = "host-app/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -2231,7 +2233,7 @@
DEVELOPMENT_TEAM = BP98Z28R86;
ENABLE_TESTABILITY = YES;
INFOPLIST_FILE = "host-app/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -2252,7 +2254,7 @@
DEVELOPMENT_TEAM = BP98Z28R86;
ENABLE_TESTABILITY = YES;
INFOPLIST_FILE = "ui-tests-app/info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -2273,7 +2275,7 @@
DEVELOPMENT_TEAM = BP98Z28R86;
ENABLE_TESTABILITY = YES;
INFOPLIST_FILE = "ui-tests-app/info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
28 changes: 12 additions & 16 deletions swift-sdk.xcodeproj/xcshareddata/xcschemes/ios9-tests.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -54,9 +54,18 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES"
onlyGenerateCoverageForSpecifiedTargets = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
onlyGenerateCoverageForSpecifiedTargets = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "ACF560D220E443BF000AAC23"
BuildableName = "host-app.app"
BlueprintName = "host-app"
ReferencedContainer = "container:swift-sdk.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CodeCoverageTargets>
<BuildableReference
BuildableIdentifier = "primary"
Expand Down Expand Up @@ -99,17 +108,6 @@
</SkippedTests>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "ACF560D220E443BF000AAC23"
BuildableName = "host-app.app"
BlueprintName = "host-app"
ReferencedContainer = "container:swift-sdk.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -131,8 +129,6 @@
ReferencedContainer = "container:swift-sdk.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1140"
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 3 additions & 1 deletion swift-sdk/Internal/DeviceInfo.swift
Expand Up @@ -7,7 +7,7 @@ import Foundation
import UIKit

struct DeviceInfo: Codable {
let mobileDeviceType = MobileDeviceType.iOS
var mobileDeviceType = MobileDeviceType.iOS
let deviceFp: DeviceFp

struct DeviceFp: Codable {
Expand Down Expand Up @@ -54,6 +54,8 @@ struct DeviceInfo: Codable {
return "AppleTV"
case .carPlay:
return "CarPlay"
case .mac:
return "Mac"
case .unspecified:
return "Other"
@unknown default:
Expand Down
2 changes: 1 addition & 1 deletion swift-sdk/Internal/InAppManager.swift
Expand Up @@ -124,7 +124,7 @@ class InAppManager: NSObject, IterableInternalInAppManagerProtocol {

// This is public (via public protocol implementation), so make sure we call from Main Thread
DispatchQueue.main.async {
_ = self.showInternal(message: message, consume: consume, callback: callback)
self.showInternal(message: message, consume: consume, callback: callback)
}
}

Expand Down
2 changes: 1 addition & 1 deletion swift-sdk/IterableAPI.swift
Expand Up @@ -9,7 +9,7 @@ import UIKit

@objcMembers public final class IterableAPI: NSObject {
// Current SDK Version.
public static let sdkVersion = "6.2.10"
public static let sdkVersion = "6.2.11"

// MARK: Initialization

Expand Down
8 changes: 0 additions & 8 deletions tests/swift-sdk-swift-tests/IterableAPIResponseTests.swift
Expand Up @@ -46,7 +46,6 @@ class IterableAPIResponseTests: XCTestCase {

func testResponseCode200WithNoData() {
let xpectation = expectation(description: "no data")
let networkSession = MockNetworkSession(statusCode: 200, data: nil)
let iterableRequest = IterableRequest.post(PostRequest(path: "", args: nil, body: [:]))

createApiClient(networkSession: MockNetworkSession(statusCode: 200, data: nil))
Expand All @@ -61,7 +60,6 @@ class IterableAPIResponseTests: XCTestCase {
func testResponseCode200WithInvalidJson() {
let xpectation = expectation(description: "invalid json")
let data = "{'''}}".data(using: .utf8)!
let networkSession = MockNetworkSession(statusCode: 200, data: data)
let iterableRequest = IterableRequest.post(PostRequest(path: "", args: nil, body: [:]))

createApiClient(networkSession: MockNetworkSession(statusCode: 200, data: data))
Expand All @@ -75,7 +73,6 @@ class IterableAPIResponseTests: XCTestCase {

func testResponseCode400WithoutMessage() { // 400 = bad reqeust
let xpectation = expectation(description: "400 without message")
let networkSession = MockNetworkSession(statusCode: 400)
let iterableRequest = IterableRequest.post(PostRequest(path: "", args: nil, body: [:]))

createApiClient(networkSession: MockNetworkSession(statusCode: 400))
Expand All @@ -89,7 +86,6 @@ class IterableAPIResponseTests: XCTestCase {

func testResponseCode400WitMessage() {
let xpectation = expectation(description: "400 with message")
let networkSession = MockNetworkSession(statusCode: 400, json: ["msg": "Test error"])
let iterableRequest = IterableRequest.post(PostRequest(path: "", args: nil, body: [:]))

createApiClient(networkSession: MockNetworkSession(statusCode: 400, json: ["msg": "Test error"]))
Expand All @@ -103,7 +99,6 @@ class IterableAPIResponseTests: XCTestCase {

func testResponseCode401() { // 401 = unauthorized
let xpectation = expectation(description: "401")
let networkSession = MockNetworkSession(statusCode: 401)
let iterableRequest = IterableRequest.post(PostRequest(path: "", args: nil, body: [:]))

createApiClient(networkSession: MockNetworkSession(statusCode: 401))
Expand All @@ -117,7 +112,6 @@ class IterableAPIResponseTests: XCTestCase {

func testResponseCode500() { // 500 = internal server error
let xpectation = expectation(description: "500")
let networkSession = MockNetworkSession(statusCode: 500)
let iterableRequest = IterableRequest.post(PostRequest(path: "", args: nil, body: [:]))

createApiClient(networkSession: MockNetworkSession(statusCode: 500))
Expand All @@ -131,7 +125,6 @@ class IterableAPIResponseTests: XCTestCase {

func testNon200ResponseCode() { // 302 = redirection
let xpectation = expectation(description: "non 200")
let networkSession = MockNetworkSession(statusCode: 302)
let iterableRequest = IterableRequest.post(PostRequest(path: "", args: nil, body: [:]))

createApiClient(networkSession: MockNetworkSession(statusCode: 302))
Expand All @@ -145,7 +138,6 @@ class IterableAPIResponseTests: XCTestCase {

func testNoNetworkResponse() {
let xpectation = expectation(description: "no network response")
let networkSession = NoNetworkNetworkSession()
let iterableRequest = IterableRequest.post(PostRequest(path: "", args: nil, body: [:]))

createApiClient(networkSession: NoNetworkNetworkSession())
Expand Down

0 comments on commit e2f23c3

Please sign in to comment.