Today widget admin packet tunnel vpn status?

Dose Today widget can admin packet tunnel vpn status? start or stop ?


When I test , I found Today widget can't load container app packet tunnal config, then show Would Like to add VPN Config?




extension NETunnelProviderManager {
    class func loadOrCreateDefaultWithCompletionHandler(completionHandler: ((NETunnelProviderManager?, NSError?) -> Void)?) {
        self.loadAllFromPreferencesWithCompletionHandler { (managers, error) -> Void in
            if let error = error {
                NSLog("Error: Could not load managers: %@", error)
                if let completionHandler = completionHandler {
                    completionHandler(nil, error)
                }
                return
            }
           
            if let managers = managers {
                if managers.indices ~= 0 {
                    if let completionHandler = completionHandler {
                        print("manager enable:\(managers[0].enabled)")
                        completionHandler(managers[0], nil)
                    }
                    return
                }
            }
           
            let config = NETunnelProviderProtocol()
            /
            /
            config.serverAddress = "240.84.1.24"
           
            let manager = NETunnelProviderManager()
            manager.protocolConfiguration = config
            manager.localizedDescription = "name"
           
          
            manager.saveToPreferencesWithCompletionHandler({ (error) -> Void in
                if let completionHandler = completionHandler {
                    if let error = error {
                        NSLog("Error: Could not create manager: %@", error)
                    }
                    completionHandler(manager, error)
                }
            })
        }
    }
}

Replies

Dose Today widget can admin packet tunnel vpn status?

Hmmm, interesting question. I suspect that this might not be possible but, before going any further, I want to make sure that you the entitlements of your Today widget are set correctly (that is, contain the necessary Network Extension special entitlements). You can use the instructions in Debugging Entitlement Issues to confirm this.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

eskimo

Can't load container Create VPN Configreation

Error: Could not create manager: Error Domain=NEVPNErrorDomain Code=5 "IPC failed"

Can Add Another One Configration , Why Limit Today widget IPC request ?

I thinks Apple Should Open it

thanks

https://pbs.twimg.com/media/CdmzJeeUUAAgnim.jpg:large


Today entitlements have add entitlements same as container app, see about Image

I found pluginType not same, is CFBundleIdentifier

Today entitlements have add entitlements same as container app, see about Image

Checking the entitlements file is not sufficient because it’s only one input to the code signing process. You have to check the final entitlements that are baked into the app and each of its sub-executables. The doc I referenced earlier shows how to do that.

I found pluginType not same, is CFBundleIdentifier

I don’t understand this.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Today widget can create VPN profile and start/stop VPN, so Today entitlements should not have problem


but Today widget can't load VPN profile which container create.

I check NETunnelProviderManager.protocolConfiguration result


    type = plugin
    identifier = CBF776A6-EC60-4F28-B617-6CB347E84836
    serverAddress = 240.84.1.24
    identityDataImported = NO
    proxySettings = {
        autoProxyDiscovery = NO
        autoProxyConfigurationEnabled = NO
        HTTPEnabled = NO
        HTTPSEnabled = NO
        FTPEnabled = NO
        SOCKSEnabled = NO
        RTSPEnabled = NO
        gopherEnabled = NO
        excludeSimpleHostnames = NO
        usePassiveFTP = YES
    }
    disconnectOnSleep = NO
    disconnectOnIdle = NO
    disconnectOnIdleTimeout = 0
    disconnectOnWake = NO
    disconnectOnWakeTimeout = 0
    pluginType = com.yarshure.Surf.SurfToday
    authenticationMethod = 0
    reassertTimeout = 0
    providerConfiguration = {
        App = com.yarshure.Surf.SurfToday
    }
    providerBundleIdentifier = com.yarshure.Surf.PacketTunnel)
    type = plugin
    identifier = B68A9975-F6A2-4528-A1DE-D66B5452860A
    serverAddress = 240.84.1.24
    identityDataImported = NO
    proxySettings = {
        autoProxyDiscovery = NO
        autoProxyConfigurationEnabled = NO
        HTTPEnabled = NO
        HTTPSEnabled = NO
        FTPEnabled = NO
        SOCKSEnabled = NO
        RTSPEnabled = NO
        gopherEnabled = NO
        excludeSimpleHostnames = NO
        usePassiveFTP = YES
    }
    disconnectOnSleep = NO
    disconnectOnIdle = NO
    disconnectOnIdleTimeout = 0
    disconnectOnWake = NO
    disconnectOnWakeTimeout = 0
    pluginType = com.yarshure.Surf
    authenticationMethod = 0
    reassertTimeout = 0
    providerConfiguration = {
        App = com.yarshure.Surf
    }
    providerBundleIdentifier = com.yarshure.Surf.PacketTunne


container app

pluginType = com.yarshure.Surf

identifier = B68A9975-F6A2-4528-A1DE-D66B5452860A

today

pluginType = com.yarshure.Surf.SurfToday

identifier = CBF776A6-EC60-4F28-B617-6CB347E84836

not same

So I think is't API lmit

Thanks

So I think is't API lmit

That’s correct. A developer opened a DTS incident to ask me about this and I’ve confirmed with VPN Engineering that this is a known limitation. We now have a bug on file requesting support for this (r. 25,869,716).

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Any updates on this? It blows my mind that despite being a "known issue" it sits solidly there (iOS 10.3). Come on, it's a bold and nonsense bug, not just a limitation. If it were a decision, it wouldn't work the way around either.

Any updates on this?

You should file your own bug report about this. The current bug (r. 25869716) got closed after the originator fail to respond to various follow-up communication requests.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Definitely, in fact I couldn't find that bug report at the time I posted. I'll take care of it. Thanks!

FWIW: r. 31007573

I found the same problem. Is anyone can resolve this? I saw the app shadowrockets and potatso2 can open the vpn on todaywidget. But I don't know how they resolve the saveToPreferences between contain app and todaywidget.



https://itunes.apple.com/us/app/potatso-2/id1162704202?mt=8


https://itunes.apple.com/us/app/shadowrocket/id932747118?mt=8