Deploy Container App of Packet Tunnel Provider Extension

I'm developing an app that makes use of the new Packet Tunnel Provider extension introduced in iOS 9.

When trying to build and run my app on an iOS 8 device I would expect the extension to just be ignored, but instead I get the error:

"This app contains an app extension that specifies an extension point identifier that is not supported on this version of iOS"


Looking online I couldn't find a solution for this.

How can I run my container app on an iOS 8 device (without the Packet Tunnel Provider extension, of course)?


Thanks!

What are you doing where the packet tunnel provider isn't the core function of your application?


I'm pretty sure the presumption for all of the network application extensions is that the extension is the core functionality, and the rest of the app is at best something used to support the extension.


Edit: I mean, this one of those extensions where you have to get approval use it, and all:

The com.apple.developer.networking.networkextension entitlement is required in order to use NEPacketTunnelProvider. To request this entitlement, send an email to networkextension@apple.com.

When the app runs on iOS versions that don't support this extension (i.e. below iOS 9) I configure the OS VPN client (instead of a custom VPN client), using NEVPNManager or a mobile configuration profile.


So even if the iOS version doens't support the extension, my app can still function properly and configure a VPN.


We've already received this entitlement and we are using the extension on iOS 9 - it runs on devices and works.

Our problem is that we want our app to be compatible with previous iOS versions as well, and when trying to run it on iOS 8 I get the mentioned error.

BTW, on iOS 7 the extension is just ignored, as I would expect to happen on iOS 8 as well, since the extension was introduced only in iOS 9.


How can I make my app ignore the extension when running on iOS 8 devices?

Found a solution for this:

To run the container app on an iOS 8 device, you need to set the deployment target of the app extension to iOS 9.

That should do it 🙂

Hi , how much it took when you requested Apple to send you Entitlement . I am also looking for implementing Per App VPN with help of NEPacketTunnel Provider and requested for entitlement also . Can you please give some refrences or sample that can help me for implementing same at this stage .

IIRC it took about 1-2 weeks to receive the entitlements.

For reference, take a look at the sample app Apple posted: https://developer.apple.com/library/ios/samplecode/SimpleTunnel/Introduction/Intro.html

Yes i am also going through the sample app by Apple for this but not able to debug due to Entitlements so facing problem in understanding the code flow . As you have implemented the Packet Tunnel so can you give me a idea for which classes and folder i have to look for implementing the Per App VPN with NEPacketTunnelProvider, Currently i am looking the flow of following :

1.PacketTunnel Folder Classes

2.SimpleTunnelServices Folder Classes

3.tunnel_server Folder Classes

i am little bit confused that i have to deal with tunnel_server Classes implementation also ?

Thanks!

Our app doesn't use the Per App VPN, so I probably don't know much more than you about this.

I would advise you to take a look at the docs about this: https://developer.apple.com/library/ios/documentation/NetworkExtension/Reference/NETunnelProviderManagerClassRef/

Regarding the tunnel_server classes - it's just a sample server for running the sample (doesn't run as part fo the app of course).

You can't use per-app vpn without cooperation from an MDM solution. You could create on-demand rules for a known set of domains from only your app or something, but per-app vpn requires your app to be tagged with an identifier at installation time.

Deploy Container App of Packet Tunnel Provider Extension
 
 
Q