I have a project that has the DataExtension target installed. In this extension I have a subclass of NEFilterDataProvider (the one that's created alongside the target). However, I don't know how to trigger the actual extension to start working. I have tried adding the following in application:didFinishLaunchingWIthOptions:[[NEFilterManager sharedManager] loadFromPreferencesWithCompletionHandler:^(NSError * _Nullable error) {
if (error) {
// This error usually does not happen.
NSLog(@"%@", error);
}
NEFilterProviderConfiguration *config = [[NEFilterProviderConfiguration alloc] init];
config.username = @"Test";
config.organization = @"Org";
config.filterBrowsers = YES;
config.filterSockets = YES;
config.serverAddress = @"Server to request new rules";
[NEFilterManager sharedManager].providerConfiguration = config;
[[NEFilterManager sharedManager] setEnabled:YES];
[[NEFilterManager sharedManager] saveToPreferencesWithCompletionHandler:^(NSError * _Nullable error) {
if (error) {
// This always returns:
// Error Domain=NEConfigurationErrorDomain Code=10 "permission denied" UserInfo={NSLocalizedDescription=permission denied}`
NSLog(@"%@", error);
}
}];
}];I have a suspicion I'm getting the denied permission because of Entitlements. My entitlements look like this:DataFilterExtension<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-/
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.appIdentifier</string>
</array>
</dict>
</plist>MainApp<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-/
<plist version="1.0">
<dict>
<key>com.apple.developer.networking.vpn.api</key>
<array>
<string>allow-vpn</string>
</array>
</dict>
</plist>I'm not sure what to do.