NEFilterManager
An object to create and manage a content filter’s configuration.
Declaration
class NEFilterManagerOverview
Each app is allowed to create a single filter configuration. The NEFilterManager class has a class method (shared()) that provides access to a single NEFilterManager instance. This single instance corresponds to a single filter configuration.
The filter configuration is stored in the Network Extension preferences which are managed by the Network Extension framework. The filter configuration must be explicitly loaded into memory from the Network Extension preferences before it can be used, and any changes must be explicitly saved to the Network Extension preferences before taking effect on the system.
Profile Configuration
Filter configurations are created using configuration profiles. See WebContentFilter for more information. To specify that a filter configuration created via a profile payload is associated with a particular app (and therefore allow the app to use NEFilterManager to manage the configuration), the app’s bundle identifier must be set as the value of the PluginBundleID field in the profile payload.
Filter Provider Extensions
Apps that use NEFilterManager are required to contain two Filter Provider extensions that together perform the task of examining network content and making pass and block decisions. See the NEFilterControlProvider and NEFilterDataProvider classes for more details about these extensions.
Topics
Managing the filter configuration
shared()loadFromPreferences(completionHandler:)saveToPreferences(completionHandler:)removeFromPreferences(completionHandler:)