NE On Demand Rule not working

Hi

I've tried to use NEOnDemandRuleEvaluateConnection with .neverConnection action like this:


        let onDemandRule = NEOnDemandRuleEvaluateConnection()
        let evaluateRule = NEEvaluateConnectionRule(matchDomains: ["ipinfo.io"], andAction: .neverConnect)
        onDemandRule.interfaceTypeMatch = .any

        onDemandRule.connectionRules = [evaluateRule]
        manager.onDemandRules = [onDemandRule]
        manager.isOnDemandEnabled = true



after successful saving and loading this configuration again (to check that VPN Manager contains this rule). I'm requesting IP address from ipinfo and get VPN IP address instead of IP address of my Wi-Fi network, why it happens?



Thanks

Replies

up

I don’t have any answers for you, alas. My recommendation is that you prototype this sort of thing using a configuration profile. If you can get that working it should be relatively easy to translate it to code. If you can’t get the configuration profile working, that’s a question to escalate via Apple Support.

Share and Enjoy

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

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