Hi,
I am working on a device level VPN(non per-app VPN) with NetworkExtension framework, one of my cases is connect VPN automatically when user access some specific domains, for example "google.com, facebook.com".So how to start the VPN automatically by system with "Connect On Demand" rules or some else approach? I've tried with below rule, but not work.
//configurating here
manager.protocolConfiguration = config
let onDemandRule1 = NEOnDemandRuleConnect()
onDemandRule1.DNSSearchDomainMatch = ["*.google.com","*.facebook.com"]
manager.onDemandRules = [onDemandRule1]
manager.onDemandEnabled = true
manager.saveToPreferencesWithCompletionHandler({ (err2) -> Void in
//error
})