We have an iOS app that uses an NETunnelProviderManager to save our packet tunnel provider preferences to the device. This properly saves Connect On Demand settings and works as predicted.
We have recently ported this to macOS, and with the exact same code, while the VPN does connect manually, the Connect On Demand settings do not work as indented.
Our onDemandRules are very simple:
private var onDemandRules:[NEOnDemandRule] {
let rule = NEOnDemandRuleConnect()
rule.probeURL = self.onDemandProbeURL
return [rule]
}
On iOS, this works as intended, with the VPN automatically reconnecting itself as long as our probe URL is accessible. On the Mac, if I disable the VPN (without disabling Connect On Demand), the VPN never reconnects itself.
Is there something I'm missing here? Are there other settings that we have to configure in our NETunnelProviderManager for macOS specifically?
We are testing this in macOS Sierra.