DefaultAvailabilityChecker
public class DefaultAvailabilityChecker : AvailabilityChecker
The standard feature availability checker that supports the user toggling features (in User Defaults) that permit this, as well as purchase-based toggling. It caches the results in order to avoid walking the feature graph every time there is a check.
To customise behaviour of user toggling, implement UserFeatureToggles
and pass it in to an instance of this class.
To customise behaviour of purchase verification, implement PurchaseValidator
and pass it in to an instance of this class.
This class implements the PurchaseRequirement
logic to test if they are all met for features that require purchases.
-
Undocumented
Declaration
Swift
public let constraintsEvaluator: ConstraintsEvaluator
-
Initialise the availability checker with the supplied feature toggle and purchase validator implementations.
Declaration
Swift
public init(constraintsEvaluator: ConstraintsEvaluator)
-
Return whether or not the feature is enabled, accordig to its
availability
type.Declaration
Swift
public func isAvailable(_ feature: ConditionalFeatureDefinition.Type) -> Bool?
-
Declaration
Swift
public func invalidate()
-
Undocumented
Declaration
Swift
public func purchaseStatusDidChange(productID: String, isPurchased: Bool)