diff --git a/Mac/AppDelegate.swift b/Mac/AppDelegate.swift index 80c78db20..d9e087551 100644 --- a/Mac/AppDelegate.swift +++ b/Mac/AppDelegate.swift @@ -200,8 +200,11 @@ let appName = "NetNewsWire" ArticleThemesManager.shared.start() NetworkMonitor.shared.start() + +#if !SKIP_APP_GROUP_ACCESS ExtensionContainersFile.shared.start() ExtensionFeedAddRequestFile.shared.start() +#endif refreshTimer = AccountRefreshTimer() ArticleStatusSyncTimer.shared.start() diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift index 1e28e01cf..007882894 100644 --- a/iOS/AppDelegate.swift +++ b/iOS/AppDelegate.swift @@ -95,8 +95,11 @@ import Secrets ArticleThemesManager.shared.start() NetworkMonitor.shared.start() + +#if !SKIP_APP_GROUP_ACCESS ExtensionContainersFile.shared.start() ExtensionFeedAddRequestFile.shared.start() +#endif #if DEBUG ArticleStatusSyncTimer.shared.update() @@ -160,7 +163,11 @@ import Secrets func prepareAccountsForBackground() { updateBadge() + +#if !SKIP_APP_GROUP_ACCESS ExtensionFeedAddRequestFile.shared.suspend() +#endif + ArticleStatusSyncTimer.shared.invalidate() scheduleBackgroundFeedRefresh() syncArticleStatus() diff --git a/xcconfig/NetNewsWire_project_debug.xcconfig b/xcconfig/NetNewsWire_project_debug.xcconfig index fe4edd6e4..4c2a80ae6 100644 --- a/xcconfig/NetNewsWire_project_debug.xcconfig +++ b/xcconfig/NetNewsWire_project_debug.xcconfig @@ -1,14 +1,20 @@ #include "./NetNewsWire_project.xcconfig" #include "./common/NetNewsWire_debug_identifiers.xcconfig" +// The SKIP_APP_GROUP_ACCESS definition suppresses app group permission dialogs +// on every launch of the debug build — at the cost of extensions not working +// as expected. To debug extensions, temporarily remove the instances +// of SKIP_APP_GROUP_ACCESS below. You will get a permissions dialog on every +// launch, which is annoying, but it will allow extensions to be debugged. +// Be sure to discard your change; do not commit it. + DEBUG_INFORMATION_FORMAT = dwarf ENABLE_TESTABILITY = YES GCC_DYNAMIC_NO_PIC = NO GCC_OPTIMIZATION_LEVEL = 0 -GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) +GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 SKIP_APP_GROUP_ACCESS=1 $(inherited) MTL_ENABLE_DEBUG_INFO = YES ONLY_ACTIVE_ARCH = YES -OTHER_SWIFT_FLAGS = -DDEBUG +OTHER_SWIFT_FLAGS = -DDEBUG -DSKIP_APP_GROUP_ACCESS SWIFT_OPTIMIZATION_LEVEL = -Onone -SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG - +SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG SKIP_APP_GROUP_ACCESS