Use active profile name in VPN configuration
Rather than "Passepartout", as seen in device settings.
This commit is contained in:
parent
7d2184d205
commit
683617ddd4
|
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## Unreleased
|
||||
|
||||
### Changed
|
||||
|
||||
- Use active profile name in VPN configuration (device settings).
|
||||
|
||||
### Fixed
|
||||
|
||||
- Incorrect tunnel bundle identifiers in Demo. [#176](https://github.com/passepartoutvpn/tunnelkit/issues/176)
|
||||
|
|
|
@ -99,6 +99,7 @@ public class StandardVPNProvider: VPNProvider {
|
|||
return
|
||||
}
|
||||
self.manager = manager
|
||||
manager.localizedDescription = configuration.title
|
||||
manager.protocolConfiguration = configuration.protocolConfiguration
|
||||
manager.onDemandRules = configuration.onDemandRules
|
||||
manager.isOnDemandEnabled = true
|
||||
|
|
|
@ -28,11 +28,17 @@ import NetworkExtension
|
|||
|
||||
/// Generic marker for objects able to configure a `VPNProvider`.
|
||||
public protocol VPNConfiguration {
|
||||
|
||||
/// The profile title in device settings.
|
||||
var title: String { get }
|
||||
}
|
||||
|
||||
/// A `VPNConfiguration` built on top of NetworkExtension entities.
|
||||
public struct NetworkExtensionVPNConfiguration: VPNConfiguration {
|
||||
|
||||
/// :nodoc:
|
||||
public var title: String
|
||||
|
||||
/// The `NETunnelProviderProtocol` object embedding tunnel configuration.
|
||||
public let protocolConfiguration: NETunnelProviderProtocol
|
||||
|
||||
|
@ -40,7 +46,8 @@ public struct NetworkExtensionVPNConfiguration: VPNConfiguration {
|
|||
public let onDemandRules: [NEOnDemandRule]
|
||||
|
||||
/// :nodoc:
|
||||
public init(protocolConfiguration: NETunnelProviderProtocol, onDemandRules: [NEOnDemandRule]) {
|
||||
public init(title: String, protocolConfiguration: NETunnelProviderProtocol, onDemandRules: [NEOnDemandRule]) {
|
||||
self.title = title
|
||||
self.protocolConfiguration = protocolConfiguration
|
||||
self.onDemandRules = onDemandRules
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue