I'm currently testing URLFilter for use in a macOS product. After calling loadFromPreferences, I set the following configuration parameters:
pirServerURL = URL(string: "http://localhost:8080")! pirAuthenticationToken = "AAAA" controlProviderBundleIdentifier = "{extension app bundle identifier}"
However, when I call saveToPreferences, I get an Invalid Configuration error. Is there a way to determine which parameter is invalid or incorrectly set?
Also, I would appreciate any macOS-specific examples of using NEURLFilterManager, as most of the documentation I’ve found seems to focus on iOS.
Thank you.
Sorry I didn’t reply earlier. This thread got a bit lost in my system.
The .configurationInvalid error is pretty generic. You might be able to get more information by converting it to an NSError and printing that. Depending on how the error was generated, the NSError variant might have more more info.
Failing that, the next thing to do is to look in the system log. NE will often log something helpful when it gets an error like this.
Finally, double check that your app and appex are both signed with an Apple Development code signing identity and are signed with the com.apple.developer.networking.networkextension that’s an array that includes the url-filter-provider value.
I would appreciate any macOS-specific examples of using NEURLFilterManager
I’d expect macOS to be very similar to iOS in this regard. Specifically, both platforms use an appex for URL filter providers, which is different from many other provider types. See TN3134 Network Extension provider deployment.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"