iOS 7以编程方式每个应用VPN

我正在开发一个iOS 7应用程序,我想知道是否“手动”(如位置服务,在哪里可以select哪个应用程序可以或不可以)激活function“每应用程序VPN”,或者我可以设置它由应用程序内的代码?

环顾networking,我发现很less有关于它的信息,并且苹果公告也没有使它清晰也…我希望提示用户进行VPNconfiguration,当他第一次打开应用程序,然后,当他是“外部“的内部Wi-Fi,我会自动激活它…

信息仍然有些粗略,但从目前我能告诉的VPN供应商将需要支持的东西,它将使用configuration文件,例如通过MDM启用。 在configuration文件中,您将像现在所做的那样定义VPNconfiguration,另外还要指定哪些应用程序使用哪个VPNconfiguration。 应用程序将不需要被修改,也不(我想)甚至知道他们正在隧道。 我不知道他们是否允许用户自己configuration,没有configuration文件。 我不明白为什么不,除了可能希望隔离普通用户的“企业”function。

我预计苹果将发布新版本的iPhoneconfiguration实用程序或苹果configuration,将允许您设置所有这一切。 如果您有权访问他们的开发者网站,那么在configuration文件中有关于XML密钥的信息可以打开它,所以你可以在没有这个工具的情况下自己制作一个configuration文件,但是如果没有VPN供应商的支持,那么你就没有多less能力去做。 我不知道是否有任何内置的VPN当前支持它。

*注意:这是一个自定义有效载荷的例子。 它需要进行修改以匹配您的VPNconfiguration,并由某些VPN提供商支持。 此示例使用L2TP的连接types。 Per-App VPN的新密钥是VPNUUID和OnDemandMatchAppEnabled。

<dict> <key>PayloadDescription</key> <string>Configures VPN settings, including authentication.</string> <key>PayloadDisplayName</key> <string>VPN (VPN Configuration)</string> <key>PayloadIdentifier</key> <string>126b636d-38ce-4bb1-a211-5239e60bd4ab</string> <key>PayloadOrganization</key> <string></string> <key>PayloadType</key> <string>com.apple.vpn.managed.applayer</string> <key>PayloadUUID</key> <string>63e3f54a-e8bd-45fd-af18-5aadfed9dc9d</string> <key>PayloadVersion</key> <integer>1</integer> <key>UserDefinedName</key> <string>VPN Configuration #12345</string> <key>VPNUUID</key> <string>b78ee624-442d-4997-a77f-dc8245109716</string> <key>OnDemandMatchAppEnabled</key> <string>True</string> <key>VPNType</key> <string>L2TP</string> <key>EAP</key> <dict /> <key>IPv4</key> <dict> <key>OverridePrimary</key> <integer>0</integer> </dict> <key>PPP</key> <dict> <key>CommRemoteAddress</key> <string>ExampleServerHostname</string> <key>CCPEnabled</key> <integer>1</integer> </dict> <key>Proxies</key> <dict /> </dict> 

有关更多信息,请访问: https : //developer.apple.com/library/ios/featuredarticles/iPhoneConfigurationProfileRef/Introduction/Introduction.html