pur*_*020 4 objective-c ios nevpnmanager
我正在使用 NetworkExtension 框架在 iOS 上使用 VPN。我能够安装配置并建立连接。我的问题是是否有办法检测 VPN 配置是否仍然安装或检测用户是否已卸载配置?
我不一定要在后台寻找通知或任何东西,但我要寻找的是一些方法/解决方法,当应用程序被带到前台时我会做些什么?
我正在使用具有中间 CA 颁发的证书的证书身份验证,并尝试从这里“评估信任”方法:检查 iOS 上是否安装了配置文件
这对我不起作用。我总是变得值得信赖。我也试过这个:
if([NEVPNManager sharedManager].protocol){
//installed
}else{
//not installed
}
Run Code Online (Sandbox Code Playgroud)
但这也行不通。卸载后协议仍然有效。如果我退出并重新启动应用程序,则协议无效。
任何建议表示赞赏。
您可以尝试以下
if ([[[NEVPNManager sharedManager] connection] status] == NEVPNStatusInvalid) {
//...
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2059 次 |
| 最近记录: |