Search code examples
iosobjective-cios9networkextension

Apple Network Extension Framework development


I am working on a project which uses Apple's Network Extension Framework. However I cant make it work. I am following the Apple's tutorial SimpleTunnel. But I am getting this error when I try to save the profile

Save error: Error Domain=NEVPNErrorDomain Code=5 "permission denied" UserInfo={NSLocalizedDescription=permission denied}

In the documentation they ask for a special entitlements. I already sent an email for it but in the meantime I just want to finish the project without going live.

Is there any workarounds? Or should I just wait a couple of months to get the "special entitlements"? Thanks.


Solution

  • Due to the confused document and function missing of xcode 8.1, this cost me one whole week to find the solution.

    1. Make sure you enrolled apple developer program (it's not free, you need to pay $100 per year)
    2. Go to https://developer.apple.com/account/ios/identifier/bundle
    3. Select Identifiers => App IDs
    4. Click your app on the right(if there is no, you could create one with xcode),
    5. Click edit button, check the network-extension checkbox

    NOTE1: Since November 10th 2016, you dont need entitlement from apple to use network-extension

    NOTE2: If you are using Hotspot Helper, go to https://developer.apple.com/contact/network-extension/

    If you are using VPN Manager, simply use capability menu of xcode project config.