From 2d0680db5413eff5f111c347b313220cc2d836e0 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Sat, 9 Nov 2019 12:18:06 +0100 Subject: [PATCH] Handle cancellationDate when parsing features --- Passepartout-iOS/Global/ProductManager.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Passepartout-iOS/Global/ProductManager.swift b/Passepartout-iOS/Global/ProductManager.swift index 5f862de3..39039409 100644 --- a/Passepartout-iOS/Global/ProductManager.swift +++ b/Passepartout-iOS/Global/ProductManager.swift @@ -122,15 +122,19 @@ class ProductManager: NSObject { if let iapReceipts = receipt.inAppPurchaseReceipts { log.debug("In-app receipts:") iapReceipts.forEach { - guard let pid = $0.productIdentifier, let date = $0.originalPurchaseDate else { + guard let pid = $0.productIdentifier, let purchaseDate = $0.originalPurchaseDate else { return } - log.debug("\t\(pid) [\(date)]") + log.debug("\t\(pid) [purchased on: \(purchaseDate)]") } for r in iapReceipts { guard let pid = r.productIdentifier, let product = Product(rawValue: pid) else { continue } + if let cancellationDate = r.cancellationDate { + log.debug("\t\(pid) [cancelled on: \(cancellationDate)]") + continue + } purchasedFeatures.insert(product) } }