I'm trying to adapt the Filter Network Traffic sample code found at https://developer.apple.com/documentation/networkextension/filtering_network_traffic
In FilterDataProvider.swift I've replaced the argument passed to NEFilterDataProvider.apply(_:completionHandler:)
with nil
, which according to the documentation should apply the default settings. Instead I'm getting the following error:
Error Domain=NEFilterErrorDomain Code=1 "The settings parameter doesn’t correspond to a NEFilterSettings object" (translated from my local language)
(When logging the error with os_log
, the Console app just shows it as <private>
. A NSLog
call instead displays it correctly.)
After that the internet doesn't seem to work at all anymore and I have to trash the app to make the internet work again. (If the bin is not completely empty before trashing the app from the Applications folder, I'm prompted that there is another operation in progress like moving a file.)
If a nil
parameter doesn't work, what is the correct way of not filtering anything, but just observing all the network traffic?