NEDNSProxyConfigurationDidChange not called

I have a NEDNSProxyProvider implementation (iOS 12+ app) and the configuration is provided through MDM.

I want to intercept any change in the proxy configuration and following the documentation I've used the NEDNSProxyConfigurationDidChange notification:


//Proxy configuration changed, probably after an update from the MDM
NotificationCenter.default.addObserver(self,
                               selector: #selector(handleDNSProxyConfigurationChanges(_:)),
                               name: NSNotification.Name.NEDNSProxyConfigurationDidChange,
                               object: nil)


But apparently the notification isn't fired, instead, the proxy is restarted by the system calling the usual


override public func stopProxy(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void)


and


overridepublicfunc startProxy(options: [String: Any]? = nil, completionHandler: @escaping (Error?) -> Void)


Is this the intended behaviour and the documentation is out of date or is this a bug?


Thanks

~Federico

Replies

But apparently the notification isn't fired …

That seems right to me.

NEDNSProxyConfigurationDidChangeNotification
is defined in
<NetworkExtension/NEDNSProxyManager.h>
, implying that it’s intended for app code (using
NEDNSProxyManager
) rather than app extension code.

I’d appreciate you filing a bug requesting that the documentation be more clear about this. Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"