I need to detect whether iphone is connected to VPN or not, programatically. I am developing a app which try to load URL, this page open only when device is connected to VPN. Before loading this URL I need to check VPN connectivity. I tried the following . But this is not working as expected.
- (BOOL)checkForVPNConnectivity {
NSDictionary *dict = (__bridge NSDictionary *)(CFNetworkCopySystemProxySettings());
//NSLog(@"cfnetwork proxy setting : %@", dict);
return [dict count] > 0;
}