Code Block swift NEFilterManager.shared().loadFromPreferences { loadError in DispatchQueue.main.async { var success = true if let error = loadError { os_log("Failed to load the filter configuration: %@", error.localizedDescription) success = false } completionHandler(success) } }
The specific error I get is:
Code Block text Failed to load configurations: Error Domain=NEConfigurationErrorDomain Code=11 "IPC failed" UserInfo={NSLocalizedDescription=IPC failed}
The code I'm testing is almost identical to Apple's SimpleFirewall example. The main difference is that I'm trying to kick things off immediately in the AppDelegate from applicationDidFinishLaunching(). I've gotten the SimpleFirewall example working so I cannot for the life of me figure out what's wrong here.
No problem. Glad that is up and running for you.So we tried those specific bundle ids, group ids, and NEMachServiceName. When we used
those it worked successfully. Thanks for that!
Yes, there are a few things that stick out to me here. First make sure your Network System Extension using the existing prefix from the container app.Maybe the network extension needs to have the container app as an effective prefix (or at least this is a best practice).
Contain App Bundle ID:
com.example.foo.bar.dev
Network Extension Bundle ID:
com.example.foo.bar.dev.networkextension
Your Network Extension Bundle ID is a new bundle id entirely.
com.example.foo.bar.dev3
Next, building upon this pattern, use the following setup:
Contain App Bundle ID:
com.example.foo.bar.dev
Container App Group:
com.example.foo.bar.dev
Network Extension Bundle ID:
com.example.foo.bar.dev.networkextension
Network Extension App Group:
$(TeamIdentifierPrefix)com.example.foo.bar.dev
Network Extension Info.plist NEMachServiceName:
$(TeamIdentifierPrefix)com.example.foo.bar.dev.networkextension
Keep the sandbox enabled on both the container app and Network System Extension.
Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com