浏览代码

Fixes #534

RecieptItem now conforms to Codable
Sam Spencer 5 年之前
父节点
当前提交
4d81f4e663

+ 5 - 5
SwiftyStoreKit.xcodeproj/project.pbxproj

@@ -582,7 +582,7 @@
 					};
 					658A083D1E2EC5120074A98F = {
 						CreatedOnToolsVersion = 8.2.1;
-						LastSwiftMigration = 1000;
+						LastSwiftMigration = 1150;
 						ProvisioningStyle = Automatic;
 						TestTargetID = 6502F5FD1B985833004E342D;
 					};
@@ -1183,8 +1183,8 @@
 				PRODUCT_BUNDLE_IDENTIFIER = com.musevisions.iOS.SwiftyStoreKitTests;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
-				SWIFT_SWIFT3_OBJC_INFERENCE = On;
-				SWIFT_VERSION = 4.2;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Default;
+				SWIFT_VERSION = 5.0;
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftyStoreKit_iOSDemo.app/SwiftyStoreKit_iOSDemo";
 			};
 			name = Debug;
@@ -1200,8 +1200,8 @@
 				PRODUCT_BUNDLE_IDENTIFIER = com.musevisions.iOS.SwiftyStoreKitTests;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
-				SWIFT_SWIFT3_OBJC_INFERENCE = On;
-				SWIFT_VERSION = 4.2;
+				SWIFT_SWIFT3_OBJC_INFERENCE = Default;
+				SWIFT_VERSION = 5.0;
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftyStoreKit_iOSDemo.app/SwiftyStoreKit_iOSDemo";
 			};
 			name = Release;

+ 1 - 1
SwiftyStoreKit/SwiftyStoreKit+Types.swift

@@ -180,7 +180,7 @@ public enum SubscriptionType {
     case nonRenewing(validDuration: TimeInterval)
 }
 
-public struct ReceiptItem: Purchased {
+public struct ReceiptItem: Purchased, Codable {
     // The product identifier of the item that was purchased. This value corresponds to the productIdentifier property of the SKPayment object stored in the transaction’s payment property.
     public let productId: String
     // The number of items purchased. This value corresponds to the quantity property of the SKPayment object stored in the transaction’s payment property.

+ 1 - 1
SwiftyStoreKitTests/InAppReceiptTests.swift

@@ -26,7 +26,6 @@
 import XCTest
 import SwiftyStoreKit
 
-// swiftlint:disable file_length
 private extension TimeInterval {
     var millisecondsNSString: NSString {
         return String(format: "%.0f", self * 1000) as NSString
@@ -107,6 +106,7 @@ extension VerifyPurchaseResult: Equatable {
     }
 }
 
+// swiftlint:disable file_length
 class InAppReceiptTests: XCTestCase {
 
     // MARK: Verify Purchase