From 44a388f0c82be5adbd93e038f5c100ebb5f34f42 Mon Sep 17 00:00:00 2001 From: Joshua Pirihi Date: Thu, 15 Dec 2022 06:16:07 +1300 Subject: [PATCH] Add security call when importing mbtiles file --- Meshtastic/MeshtasticApp.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Meshtastic/MeshtasticApp.swift b/Meshtastic/MeshtasticApp.swift index 98958a3e..84ae1e6a 100644 --- a/Meshtastic/MeshtasticApp.swift +++ b/Meshtastic/MeshtasticApp.swift @@ -66,6 +66,12 @@ struct MeshtasticAppleApp: App { let destination = documentsDirectory.appendingPathComponent("offline_map.mbtiles", isDirectory: false) if !self.saveChannels { + + //tell the system we want the file please + guard url.startAccessingSecurityScopedResource() else { + return + } + //do we need to delete an old one? if (fileManager.fileExists(atPath: destination.path)) { print("ℹ️ Found an old map file. Deleting it")