From 79672fa920c4fc1ef910b02a6e2d2261df051700 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Thu, 1 Nov 2018 18:54:08 +0530 Subject: [PATCH] NE: Show an alert when someone tries to start the VPN from iOS Settings --- .../WireGuardNetworkExtension/PacketTunnelProvider.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift b/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift index 766840d..46184fa 100644 --- a/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift +++ b/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift @@ -27,8 +27,11 @@ class PacketTunnelProvider: NEPacketTunnelProvider { os_log("Starting tunnel", log: OSLog.default, type: .info) guard let options = options else { - os_log("Starting tunnel failed: No options passed", log: OSLog.default, type: .error) - startTunnelCompletionHandler(PacketTunnelProviderError.invalidOptions) + os_log("Starting tunnel failed: No options passed. Possible connection request from preferences.", log: OSLog.default, type: .error) + // displayMessage is deprecated API + displayMessage("Please use the WireGuard app to start up WireGuard VPN configurations.") { (_) in + startTunnelCompletionHandler(PacketTunnelProviderError.invalidOptions) + } return }