Extend features retrieval with excluding filter
This commit is contained in:
parent
9566bac598
commit
3fb1a607cf
|
@ -70,7 +70,7 @@ class PurchaseViewController: UITableViewController, StrongTableHost {
|
|||
rows.append(.restore)
|
||||
model.set(rows, forSection: .products)
|
||||
|
||||
let featureBulletsList: [String] = ProductManager.shared.featureProducts(includingFullVersion: false).map {
|
||||
let featureBulletsList: [String] = ProductManager.shared.featureProducts(excluding: [.fullVersion, .fullVersion_iOS]).map {
|
||||
return "- \($0.localizedTitle)"
|
||||
}.sortedCaseInsensitive()
|
||||
let featureBullets = featureBulletsList.joined(separator: "\n")
|
||||
|
|
|
@ -118,12 +118,12 @@ public class ProductManager: NSObject {
|
|||
return inApp.product(withIdentifier: identifier)
|
||||
}
|
||||
|
||||
public func featureProducts(includingFullVersion: Bool) -> [SKProduct] {
|
||||
public func featureProducts(excluding: [Product]) -> [SKProduct] {
|
||||
return inApp.products.filter {
|
||||
guard let p = Product(rawValue: $0.productIdentifier) else {
|
||||
return false
|
||||
}
|
||||
guard includingFullVersion || p != .fullVersion else {
|
||||
guard !excluding.contains(p) else {
|
||||
return false
|
||||
}
|
||||
guard p.isFeature else {
|
||||
|
|
Loading…
Reference in New Issue