Parcourir la source

Merge pull request #404 from frogg/master

Added new property "isInIntroOfferPeriod" to ReceiptItem
Andrea Bizzotto il y a 6 ans
Parent
commit
ca9d3ffd08

+ 5 - 0
SwiftyStoreKit/InAppReceipt.swift

@@ -64,6 +64,11 @@ extension ReceiptItem {
         } else {
             self.isTrialPeriod = false
         }
+        if let isInIntroOfferPeriod = receiptInfo["is_in_intro_offer_period"] as? String {
+            self.isInIntroOfferPeriod = Bool(isInIntroOfferPeriod) ?? false
+        } else {
+            self.isInIntroOfferPeriod = false
+        }
     }
 
     private static func parseDate(from receiptInfo: ReceiptInfo, key: String) -> Date? {

+ 2 - 0
SwiftyStoreKit/SwiftyStoreKit+Types.swift

@@ -139,6 +139,8 @@ public struct ReceiptItem {
     public let cancellationDate: Date?
 
     public let isTrialPeriod: Bool
+    
+    public let isInIntroOfferPeriod: Bool
 }
 
 // Error when managing receipt