iOS 8 向后兼容使用 NETunnelProviderManager 的应用程序

Backwards compatibility on iOS 8 with an app that uses NETunnelProviderManager

我有一个应用目前在 iOS 8 上运行良好,我们正在通过 NETunnelProviderManager 添加对设备级 VPN 的支持。带有 VPN 扩展的应用程序在 iOS 9 和 10 上运行良好,但现在不再安装在 iOS 8 中并出现以下错误:

[Error :appex bundle at /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.tdt5DO/extracted/MYAPP.app/PlugIns/NetworkExtension.appex with id myapp.ID specifies a value (com.apple.networkextension.packet-tunnel) for the NSExtensionPointIdentifier key in the NSExtension dictionary in its Info.plist that does not correspond to a known extension point] 

我计划在运行时检查 iOS 版本,只是不调用这些 API,但由于这次失败,应用程序甚至无法进入运行时。

有没有办法让我在运行时安装和处理它?只为 iOS 8.

制作一个单独的应用程序对我来说不太可行

虽然我的应用程序使用 VPN 扩展程序,但它可以做一些事情 w/o 所以我想继续 iOS 8 支持,至少在一段时间内。

解决方案只是为我的插件项目选择正确的 iOS 目标,这样它就不会安装在不支持它的操作系统上。