Handle cancellationDate when parsing features

This commit is contained in:
Davide De Rosa 2019-11-09 12:18:06 +01:00
parent 08ff3d01dc
commit 2d0680db54
1 changed files with 6 additions and 2 deletions

View File

@ -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)
}
}