Skip to content

Commit 0a354be

Browse files
committed
Update podspec. Update model parameters to appropriate type.
1 parent c9c5cca commit 0a354be

10 files changed

+68
-67
lines changed

Example/Example.xcodeproj/project.pbxproj

+18-18
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
A718C04D21CED043004D7EF7 /* Sources */,
143143
A718C04E21CED043004D7EF7 /* Frameworks */,
144144
A718C04F21CED043004D7EF7 /* Resources */,
145-
C9B5801DB6CCDE2A4690E82D /* [CP] Embed Pods Frameworks */,
145+
0639A003959619301792F192 /* [CP] Embed Pods Frameworks */,
146146
);
147147
buildRules = (
148148
);
@@ -231,29 +231,24 @@
231231
/* End PBXResourcesBuildPhase section */
232232

233233
/* Begin PBXShellScriptBuildPhase section */
234-
55C74095CE7990FC78D0FD3A /* [CP] Check Pods Manifest.lock */ = {
234+
0639A003959619301792F192 /* [CP] Embed Pods Frameworks */ = {
235235
isa = PBXShellScriptBuildPhase;
236236
buildActionMask = 2147483647;
237237
files = (
238238
);
239239
inputFileListPaths = (
240+
"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-input-files.xcfilelist",
240241
);
241-
inputPaths = (
242-
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
243-
"${PODS_ROOT}/Manifest.lock",
244-
);
245-
name = "[CP] Check Pods Manifest.lock";
242+
name = "[CP] Embed Pods Frameworks";
246243
outputFileListPaths = (
247-
);
248-
outputPaths = (
249-
"$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt",
244+
"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-output-files.xcfilelist",
250245
);
251246
runOnlyForDeploymentPostprocessing = 0;
252247
shellPath = /bin/sh;
253-
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
248+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n";
254249
showEnvVarsInLog = 0;
255250
};
256-
67B150B3A0E5E000F9DEA9C6 /* [CP] Check Pods Manifest.lock */ = {
251+
55C74095CE7990FC78D0FD3A /* [CP] Check Pods Manifest.lock */ = {
257252
isa = PBXShellScriptBuildPhase;
258253
buildActionMask = 2147483647;
259254
files = (
@@ -268,28 +263,33 @@
268263
outputFileListPaths = (
269264
);
270265
outputPaths = (
271-
"$(DERIVED_FILE_DIR)/Pods-ExampleTests-checkManifestLockResult.txt",
266+
"$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt",
272267
);
273268
runOnlyForDeploymentPostprocessing = 0;
274269
shellPath = /bin/sh;
275270
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
276271
showEnvVarsInLog = 0;
277272
};
278-
C9B5801DB6CCDE2A4690E82D /* [CP] Embed Pods Frameworks */ = {
273+
67B150B3A0E5E000F9DEA9C6 /* [CP] Check Pods Manifest.lock */ = {
279274
isa = PBXShellScriptBuildPhase;
280275
buildActionMask = 2147483647;
281276
files = (
282277
);
283278
inputFileListPaths = (
284-
"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-input-files.xcfilelist",
285279
);
286-
name = "[CP] Embed Pods Frameworks";
280+
inputPaths = (
281+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
282+
"${PODS_ROOT}/Manifest.lock",
283+
);
284+
name = "[CP] Check Pods Manifest.lock";
287285
outputFileListPaths = (
288-
"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-output-files.xcfilelist",
286+
);
287+
outputPaths = (
288+
"$(DERIVED_FILE_DIR)/Pods-ExampleTests-checkManifestLockResult.txt",
289289
);
290290
runOnlyForDeploymentPostprocessing = 0;
291291
shellPath = /bin/sh;
292-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n";
292+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
293293
showEnvVarsInLog = 0;
294294
};
295295
/* End PBXShellScriptBuildPhase section */

InPlayerSDK.podspec

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "InPlayerSDK"
19-
s.version = "1.5.13"
19+
s.version = "3.0.0"
2020
s.summary = "InPlayer's iOS API client wrapper."
2121

2222
# This description is used to generate tags and improve search results.
@@ -119,13 +119,13 @@ Pod::Spec.new do |s|
119119

120120
s.subspec 'Core' do |core|
121121
core.source_files = "Source/Core/**/*.*"
122-
core.dependency 'Alamofire', '5.0.0-rc.3'
122+
core.dependency 'Alamofire', '5.2.0'
123123
end
124124

125125
s.subspec 'Notification' do |notification|
126126
notification.source_files = "Source/Notification/**/*.*"
127127
notification.dependency 'InPlayerSDK/Core'
128-
notification.dependency 'AWSIoT', '2.12.1'
128+
notification.dependency 'AWSIoT', '2.13.4'
129129
end
130130

131131
s.subspec 'Payment' do |payment|

InPlayerSDK.xcodeproj/project.pbxproj

+12-8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/* Begin PBXBuildFile section */
1010
753F5D595D59548CC1AF1909 /* Pods_InPlayerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89DF19FEC807CF03559464F9 /* Pods_InPlayerSDK.framework */; };
11+
A725D2462479A85900255FBB /* IntExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = A725D2452479A85900255FBB /* IntExt.swift */; };
1112
A73211D0223AD06E00452C15 /* InPlayerCustomerAccessItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = A73211CF223AD06E00452C15 /* InPlayerCustomerAccessItem.swift */; };
1213
A73211D6223AD42300452C15 /* InPlayerPurchaseHistory.swift in Sources */ = {isa = PBXBuildFile; fileRef = A73211D5223AD42300452C15 /* InPlayerPurchaseHistory.swift */; };
1314
A73211DA223C0D7E00452C15 /* InPlayerRegisterField.swift in Sources */ = {isa = PBXBuildFile; fileRef = A73211D9223C0D7E00452C15 /* InPlayerRegisterField.swift */; };
@@ -117,6 +118,7 @@
117118
863B37A5E53B1B204C406696 /* Pods-InPlayerSDKTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InPlayerSDKTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InPlayerSDKTests/Pods-InPlayerSDKTests.debug.xcconfig"; sourceTree = "<group>"; };
118119
89DF19FEC807CF03559464F9 /* Pods_InPlayerSDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_InPlayerSDK.framework; sourceTree = BUILT_PRODUCTS_DIR; };
119120
A42AFBEAB4A1A9893C497B3B /* Pods-InPlayerSDK.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InPlayerSDK.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InPlayerSDK/Pods-InPlayerSDK.debug.xcconfig"; sourceTree = "<group>"; };
121+
A725D2452479A85900255FBB /* IntExt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntExt.swift; sourceTree = "<group>"; };
120122
A73211CF223AD06E00452C15 /* InPlayerCustomerAccessItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InPlayerCustomerAccessItem.swift; sourceTree = "<group>"; };
121123
A73211D5223AD42300452C15 /* InPlayerPurchaseHistory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InPlayerPurchaseHistory.swift; sourceTree = "<group>"; };
122124
A73211D9223C0D7E00452C15 /* InPlayerRegisterField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InPlayerRegisterField.swift; sourceTree = "<group>"; };
@@ -283,6 +285,14 @@
283285
path = Subscription;
284286
sourceTree = "<group>";
285287
};
288+
A76EA290237866E800B13D41 /* Resource */ = {
289+
isa = PBXGroup;
290+
children = (
291+
A73211EA2240114C00452C15 /* countries.json */,
292+
);
293+
path = Resource;
294+
sourceTree = "<group>";
295+
};
286296
A76EA2912378914B00B13D41 /* AssetTypes */ = {
287297
isa = PBXGroup;
288298
children = (
@@ -311,14 +321,6 @@
311321
A76EA2B223789F1D00B13D41 /* AssetJSONDecoder.swift */,
312322
);
313323
path = AssetDecoder;
314-
sourceTree = "<group>";
315-
};
316-
A76EA290237866E800B13D41 /* Resource */ = {
317-
isa = PBXGroup;
318-
children = (
319-
A73211EA2240114C00452C15 /* countries.json */,
320-
);
321-
path = Resource;
322324
sourceTree = "<group>";
323325
};
324326
A7EA960521F5018600CDA238 = {
@@ -386,6 +388,7 @@
386388
A7EA963121F501F000CDA238 /* DateExt.swift */,
387389
A7C4C8902270A92200EF6CF4 /* StringExt.swift */,
388390
A7C4C8922270A97400EF6CF4 /* DictionaryExt.swift */,
391+
A725D2452479A85900255FBB /* IntExt.swift */,
389392
A7A690D5227CB0C10039AB59 /* NotificationNameExt.swift */,
390393
);
391394
path = Extensions;
@@ -733,6 +736,7 @@
733736
A7EA96DF21F52C0000CDA238 /* INPCredentialProvider.swift in Sources */,
734737
A7EA966821F501F000CDA238 /* Configuration.swift in Sources */,
735738
A7EA966D21F501F000CDA238 /* InPlayer.swift in Sources */,
739+
A725D2462479A85900255FBB /* IntExt.swift in Sources */,
736740
A76EA2B1237892B400B13D41 /* WowzaAsset.swift in Sources */,
737741
A7EA96D421F52B8400CDA238 /* INPAssetService.swift in Sources */,
738742
A7EA967C21F501F000CDA238 /* InPlayerAccount.swift in Sources */,

Source/Core/API/Asset/INPAssetService.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class INPAssetService {
5656
private struct AssetParameters {
5757
static let merchantUUID = "merchant_uuid"
5858
static let entryId = "entry_id"
59-
static let voucherExpand = "voucher[expand]"
59+
static let voucherExpand = "expand[voucher]"
6060
}
6161

6262

Source/Core/Extensions/IntExt.swift

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// IntExt.swift
3+
// InPlayerSDK
4+
//
5+
// Created by Oliver Dimitrov on 5/23/20.
6+
// Copyright © 2020 InPlayer. All rights reserved.
7+
//
8+
9+
import Foundation
10+
11+
extension Int {
12+
var boolValue: Bool { return self != 0 }
13+
}

Source/Core/Models/Asset/InPlayerAccessControlType.swift

+8-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@ public struct InPlayerAccessControlType : Codable {
2424
public init(from decoder: Decoder) throws {
2525
let values = try decoder.container(keyedBy: CodingKeys.self)
2626
id = try values.decodeIfPresent(Int.self, forKey: .id)
27-
auth = try values.decodeIfPresent(Bool.self, forKey: .auth)
2827
name = try values.decodeIfPresent(String.self, forKey: .name)
28+
29+
do {
30+
auth = try values.decodeIfPresent(Bool.self, forKey: .auth)
31+
} catch DecodingError.typeMismatch {
32+
// There was something for the "auth" key, but it wasn't a boolean value. Try a Int.
33+
if let value = try values.decodeIfPresent(Int.self, forKey: .auth) { auth = value.boolValue }
34+
else { auth = false }
35+
}
2936
}
30-
3137
}

Source/Core/Models/Asset/InPlayerAccessFee.swift

+5-27
Original file line numberDiff line numberDiff line change
@@ -45,34 +45,9 @@ public struct InPlayerAccessFee : Codable {
4545
/// The date the access expires, measured in seconds since 1 January 1970 (UTC) Note: This only applies for the custom access type
4646
public let expiresAt: Double?
4747

48+
public let startsAt: Double?
49+
4850
enum CodingKeys: String, CodingKey {
49-
/**
50-
"id": 17308,
51-
"merchant_id": 21,
52-
"item_id": 72545,
53-
"amount": 5,
54-
"currency": "EUR",
55-
"description": "Price With Everything",
56-
"created_at": 1588234030,
57-
"updated_at": 1588234030,
58-
"starts_at": 1585735200,
59-
"expires_at": 1609498800,
60-
"access_type": {},
61-
"item": {},
62-
"trial_period": {},
63-
"setup_fee": {},
64-
"geo_restriction": {},
65-
"external_fees": [
66-
{
67-
"id": 459,
68-
"payment_provider_id": 14,
69-
"access_fee_id": 17308,
70-
"external_id": "123",
71-
"merchant_id": 21
72-
}
73-
],
74-
"seasonal_fee": {}
75-
*/
7651

7752
case voucherRule = "voucher_rule"
7853
case id = "id"
@@ -88,6 +63,7 @@ public struct InPlayerAccessFee : Codable {
8863
case seasonalFee = "seasonal_fee"
8964
case expiresAt = "expires_at"
9065
case externalFees = "external_fees"
66+
case startsAt = "starts_at"
9167
}
9268

9369
/// Decoder Method
@@ -107,6 +83,7 @@ public struct InPlayerAccessFee : Codable {
10783
seasonalFee = try values.decodeIfPresent(InPlayerSeasonalFee.self, forKey: .seasonalFee)
10884
expiresAt = try values.decodeIfPresent(Double.self, forKey: .expiresAt)
10985
externalFees = try values.decodeIfPresent([InPlayerExternalFee].self, forKey: .externalFees)
86+
startsAt = try values.decodeIfPresent(Double.self, forKey: .startsAt)
11087
}
11188

11289
/// Encoder method
@@ -126,6 +103,7 @@ public struct InPlayerAccessFee : Codable {
126103
try values.encodeIfPresent(seasonalFee, forKey: .seasonalFee)
127104
try values.encodeIfPresent(expiresAt, forKey: .expiresAt)
128105
try values.encodeIfPresent(externalFees, forKey: .externalFees)
106+
try values.encodeIfPresent(startsAt, forKey: .startsAt)
129107
}
130108

131109
}

Source/Core/Models/Asset/InPlayerExternalFee.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public struct InPlayerExternalFee: Codable {
1313
public let id: Int?
1414
public let paymentProviderId: Int?
1515
public let accessFeeId: Int?
16-
public let externalId: Int?
16+
public let externalId: String?
1717
public let merchantId: Int?
1818

1919
enum CodingKeys: String, CodingKey {
@@ -30,7 +30,7 @@ public struct InPlayerExternalFee: Codable {
3030
id = try values.decodeIfPresent(Int.self, forKey: .id)
3131
paymentProviderId = try values.decodeIfPresent(Int.self, forKey: .paymentProviderId)
3232
accessFeeId = try values.decodeIfPresent(Int.self, forKey: .accessFeeId)
33-
externalId = try values.decodeIfPresent(Int.self, forKey: .externalId)
33+
externalId = try values.decodeIfPresent(String.self, forKey: .externalId)
3434
merchantId = try values.decodeIfPresent(Int.self, forKey: .merchantId)
3535
}
3636

Source/Core/Models/Asset/InPlayerVoucher.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public struct InPlayerVoucher: Codable {
2323
public let rebillDiscount: Int?
2424

2525
/// Voucher is valid from this date forward
26-
public let startDate: String?
26+
public let startDate: Double?
2727

2828
/// Voucher validation ends on this date
29-
public let endDate: String?
29+
public let endDate: Double?
3030

3131
/// Code provided by the merchant instead of generating it automatically
3232
public let code: String?
@@ -64,8 +64,8 @@ public struct InPlayerVoucher: Codable {
6464
name = try values.decodeIfPresent(String.self, forKey: .name)
6565
discount = try values.decodeIfPresent(Int.self, forKey: .discount)
6666
rebillDiscount = try values.decodeIfPresent(Int.self, forKey: .rebillDiscount)
67-
startDate = try values.decodeIfPresent(String.self, forKey: .startDate)
68-
endDate = try values.decodeIfPresent(String.self, forKey: .endDate)
67+
startDate = try values.decodeIfPresent(Double.self, forKey: .startDate)
68+
endDate = try values.decodeIfPresent(Double.self, forKey: .endDate)
6969
code = try values.decodeIfPresent(String.self, forKey: .code)
7070
usageLimit = try values.decodeIfPresent(Int.self, forKey: .usageLimit)
7171
usageCounter = try values.decodeIfPresent(Int.self, forKey: .usageCounter)

Source/Core/Models/Asset/InPlayerVoucherRule.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public struct InPlayerVoucherRule: Codable {
1717
public let ruleType: String?
1818

1919
/// Value
20-
public let value: Int?
20+
public let value: String?
2121

2222
/// Voucher
2323
public let voucher: InPlayerVoucher?
@@ -34,7 +34,7 @@ public struct InPlayerVoucherRule: Codable {
3434
let values = try decoder.container(keyedBy: CodingKeys.self)
3535
id = try values.decodeIfPresent(Int.self, forKey: .id)
3636
ruleType = try values.decodeIfPresent(String.self, forKey: .ruleType)
37-
value = try values.decodeIfPresent(Int.self, forKey: .value)
37+
value = try values.decodeIfPresent(String.self, forKey: .value)
3838
voucher = try values.decodeIfPresent(InPlayerVoucher.self, forKey: .voucher)
3939
}
4040

0 commit comments

Comments
 (0)