fix: relaunching of iOS app would stop advertising

This commit is contained in:
Leon Böttger committed 2025-08-18 10:36:31 +02:00
1 parent 9d71ed35b7
commit 7d6d0f3482
6 files changed
+66 -14

No files matched your search

+1 -7
View File
@@ -24,14 +24,8 @@ final class LogManager {
/// Private initializer
private init() {
#if os(macOS)
// Use the App Group container
let directory = getAppGroupDirectory()
#else
// On iOS, use the library directory, to not let the logs appear in the files app
let directory = FileManager.default.urls(for: .libraryDirectory, in: .userDomainMask).first
#endif
// Create file name from date
let formatter = DateFormatter()
@@ -133,7 +127,7 @@ public func log(_ text: String) {
/// Returns the shared App Group directory
fileprivate func getAppGroupDirectory() -> URL? {
func getAppGroupDirectory() -> URL? {
let groupIdentifier = "group.com.leonboettger.neardrop"
return FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: groupIdentifier)
}