aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/Shared/FileManager+Extension.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-12-28 00:33:31 +0530
committerRoopesh Chander <roop@roopc.net>2019-01-14 14:52:28 +0530
commitd7d4355f5efa9c78d721392c4d7d6474105f29c8 (patch)
tree89b338d97b44499a08a407f4bb8536ea16b55f2a /WireGuard/Shared/FileManager+Extension.swift
parentmacOS: Add Network Extensions capability to app (diff)
downloadwireguard-apple-d7d4355f5efa9c78d721392c4d7d6474105f29c8.tar.xz
wireguard-apple-d7d4355f5efa9c78d721392c4d7d6474105f29c8.zip
Make app groups work on both iOS and macOS
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/Shared/FileManager+Extension.swift')
-rw-r--r--WireGuard/Shared/FileManager+Extension.swift7
1 files changed, 6 insertions, 1 deletions
diff --git a/WireGuard/Shared/FileManager+Extension.swift b/WireGuard/Shared/FileManager+Extension.swift
index 5873f3b..d98cd0a 100644
--- a/WireGuard/Shared/FileManager+Extension.swift
+++ b/WireGuard/Shared/FileManager+Extension.swift
@@ -6,7 +6,12 @@ import os.log
extension FileManager {
private static var sharedFolderURL: URL? {
- guard let appGroupId = Bundle.main.object(forInfoDictionaryKey: "com.wireguard.ios.app_group_id") as? String else {
+ #if os(iOS)
+ let appGroupIdInfoDictionaryKey = "com.wireguard.ios.app_group_id"
+ #elseif os(OSX)
+ let appGroupIdInfoDictionaryKey = "com.wireguard.macos.app_group_id"
+ #endif
+ guard let appGroupId = Bundle.main.object(forInfoDictionaryKey: appGroupIdInfoDictionaryKey) as? String else {
os_log("Cannot obtain app group ID from bundle", log: OSLog.default, type: .error)
return nil
}