From 4f8a669967c4eb9d418eee52109994e2b64cda48 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Sat, 13 Apr 2019 11:04:46 +0200 Subject: [PATCH] Clarify App Groups usage in Demo --- Demo/BasicTunnel-iOS/ViewController.swift | 6 +++--- Demo/BasicTunnel-macOS/ViewController.swift | 6 +++--- README.md | 7 +++++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Demo/BasicTunnel-iOS/ViewController.swift b/Demo/BasicTunnel-iOS/ViewController.swift index b63e519..9796f0c 100644 --- a/Demo/BasicTunnel-iOS/ViewController.swift +++ b/Demo/BasicTunnel-iOS/ViewController.swift @@ -78,7 +78,7 @@ YDQ8z9v+DMO6iwyIDRiU extension ViewController { private static let appGroup = "group.com.algoritmico.ios.demo.BasicTunnel" - private static let bundleIdentifier = "com.algoritmico.ios.demo.BasicTunnel.BasicTunnelExtension" + private static let tunnelIdentifier = "com.algoritmico.ios.demo.BasicTunnel.BasicTunnelExtension" private func makeProtocol() -> NETunnelProviderProtocol { let server = textServer.text! @@ -105,7 +105,7 @@ extension ViewController { let configuration = builder.build() return try! configuration.generatedTunnelProtocol( - withBundleIdentifier: ViewController.bundleIdentifier, + withBundleIdentifier: ViewController.tunnelIdentifier, appGroup: ViewController.appGroup, credentials: credentials ) @@ -263,7 +263,7 @@ class ViewController: UIViewController, URLSessionDataDelegate { for m in managers! { if let p = m.protocolConfiguration as? NETunnelProviderProtocol { - if (p.providerBundleIdentifier == ViewController.bundleIdentifier) { + if (p.providerBundleIdentifier == ViewController.tunnelIdentifier) { manager = m break } diff --git a/Demo/BasicTunnel-macOS/ViewController.swift b/Demo/BasicTunnel-macOS/ViewController.swift index ebe3816..a2e30d7 100644 --- a/Demo/BasicTunnel-macOS/ViewController.swift +++ b/Demo/BasicTunnel-macOS/ViewController.swift @@ -78,7 +78,7 @@ YDQ8z9v+DMO6iwyIDRiU extension ViewController { private static let appGroup = "DTDYD63ZX9.group.com.algoritmico.macos.demo.BasicTunnel" - private static let bundleIdentifier = "com.algoritmico.macos.demo.BasicTunnel.BasicTunnelExtension" + private static let tunnelIdentifier = "com.algoritmico.macos.demo.BasicTunnel.BasicTunnelExtension" private func makeProtocol() -> NETunnelProviderProtocol { let server = textServer.stringValue @@ -106,7 +106,7 @@ extension ViewController { let configuration = builder.build() return try! configuration.generatedTunnelProtocol( - withBundleIdentifier: ViewController.bundleIdentifier, + withBundleIdentifier: ViewController.tunnelIdentifier, appGroup: ViewController.appGroup, credentials: credentials ) @@ -239,7 +239,7 @@ class ViewController: NSViewController { for m in managers! { if let p = m.protocolConfiguration as? NETunnelProviderProtocol { - if (p.providerBundleIdentifier == ViewController.bundleIdentifier) { + if (p.providerBundleIdentifier == ViewController.tunnelIdentifier) { manager = m break } diff --git a/README.md b/README.md index aee3a27..8f9aca7 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,13 @@ Example: -----END CERTIFICATE----- """) +Make sure to also update the following constants in the same files, according to your developer account and your target bundle identifiers: + + public static let appGroup + public static let tunnelIdentifier + +Remember that the App Group on macOS requires a team ID prefix. + ## Documentation The library is split into two modules, in order to decouple the low-level protocol implementation from the platform-specific bridging, namely the [NetworkExtension][ne-home] VPN framework.