diff --git a/QuickDrop.xcodeproj/project.pbxproj b/QuickDrop.xcodeproj/project.pbxproj index cabef59..2bc31db 100644 --- a/QuickDrop.xcodeproj/project.pbxproj +++ b/QuickDrop.xcodeproj/project.pbxproj @@ -503,6 +503,8 @@ 69DA9A2C29E18CB500A442DA /* securegcm.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = securegcm.pb.swift; sourceTree = ""; }; 69DA9A2D29E18CB500A442DA /* securemessage.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = securemessage.pb.swift; sourceTree = ""; }; A1B2C3DA2F33AA0100ABC001 /* MirroredNotificationSupport.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MirroredNotificationSupport.swift; sourceTree = ""; }; + A1F5B3D82F3A1A0100A1B2C3 /* NotificationSyncPairingToken.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationSyncPairingToken.swift; sourceTree = ""; }; + A1F5B3D92F3A1A0100A1B2C4 /* NotificationSyncQrSheetManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationSyncQrSheetManager.swift; sourceTree = ""; }; EB05DFBD2E59FC8000EF567A /* TrustedDevicesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrustedDevicesView.swift; sourceTree = ""; }; EB1325D22E701D8900FD749C /* Settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Settings.swift; sourceTree = ""; }; EB1325E72E7025D900FD749C /* ActiveNetworkInterface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActiveNetworkInterface.swift; sourceTree = ""; }; @@ -515,7 +517,6 @@ EB16B7762E59BA9F007D9792 /* AppGroup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppGroup.swift; sourceTree = ""; }; EB2B41E32DC63AC80070FC39 /* SleepManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SleepManager.swift; sourceTree = ""; }; EB2F9BFA2DA04B67004010A2 /* Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Helpers.swift; sourceTree = ""; }; - A1F5B3D82F3A1A0100A1B2C3 /* NotificationSyncPairingToken.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationSyncPairingToken.swift; sourceTree = ""; }; EB36435F2D73A29F009CDFF8 /* AudioManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioManager.swift; sourceTree = ""; }; EB3B9F482EF7150400D6704E /* QuickDropGitHub.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QuickDropGitHub.app; sourceTree = BUILT_PRODUCTS_DIR; }; EB3B9F492EF7150400D6704E /* QuickDrop copy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "QuickDrop copy-Info.plist"; path = "/Users/leonboettger/QuickDrop Backup with git/QuickDrop copy-Info.plist"; sourceTree = ""; }; @@ -540,7 +541,6 @@ EB7F54112D78E95C00989564 /* TutorialView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TutorialView.swift; sourceTree = ""; }; EB7F54132D78E9E400989564 /* LicenseWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LicenseWindow.swift; sourceTree = ""; }; EB869DB42E92AA33009AAAD4 /* QuickDropToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuickDropToastView.swift; sourceTree = ""; }; - A1F5B3D92F3A1A0100A1B2C4 /* NotificationSyncQrSheetManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationSyncQrSheetManager.swift; sourceTree = ""; }; EB886E512E4E19390052B7D9 /* HKDF.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HKDF.swift; sourceTree = ""; }; EB886E662E4F2F7C0052B7D9 /* License.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = License.swift; sourceTree = ""; }; EB950B2D2E52027F002D68FA /* iOSShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = iOSShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -750,6 +750,14 @@ path = NearbyShare; sourceTree = ""; }; + A1F5B3DA2F3A1A0100A1B2C5 /* NotificationSync */ = { + isa = PBXGroup; + children = ( + A1F5B3D92F3A1A0100A1B2C4 /* NotificationSyncQrSheetManager.swift */, + ); + path = NotificationSync; + sourceTree = ""; + }; EB1325EA2E7025D900FD749C /* SelfTest */ = { isa = PBXGroup; children = ( @@ -911,14 +919,6 @@ path = View; sourceTree = ""; }; - A1F5B3DA2F3A1A0100A1B2C5 /* NotificationSync */ = { - isa = PBXGroup; - children = ( - A1F5B3D92F3A1A0100A1B2C4 /* NotificationSyncQrSheetManager.swift */, - ); - path = NotificationSync; - sourceTree = ""; - }; EBC05C6B2E33B57100EECC18 /* Util */ = { isa = PBXGroup; children = ( @@ -1773,8 +1773,8 @@ MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; - SHARED_BUILD = 135; - SHARED_VERSION = 3.0; + SHARED_BUILD = 136; + SHARED_VERSION = 2.14; STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_EMIT_LOC_STRINGS = YES; @@ -1836,8 +1836,8 @@ MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = macosx; - SHARED_BUILD = 135; - SHARED_VERSION = 3.0; + SHARED_BUILD = 136; + SHARED_VERSION = 2.14; STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/QuickDrop.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/QuickDrop.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7f5ddd6..e750d73 100644 --- a/QuickDrop.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/QuickDrop.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -52,7 +52,7 @@ "location" : "https://github.com/leonboe1/LUI.git", "state" : { "branch" : "main", - "revision" : "309e17d643ca804788bc4ddcebaa111170f8c067" + "revision" : "d6848df0e7a5b6545439e5227ecabe8f296cdc4b" } }, { @@ -87,8 +87,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-protobuf.git", "state" : { - "revision" : "86970144a0b86068c81ff48ee29b3f97cae0b879", - "version" : "1.36.0" + "revision" : "a008af1a102ff3dd6cc3764bb69bf63226d0f5f6", + "version" : "1.36.1" } }, { diff --git a/QuickDrop/AppDelegate.swift b/QuickDrop/AppDelegate.swift index 9143f46..07713c5 100644 --- a/QuickDrop/AppDelegate.swift +++ b/QuickDrop/AppDelegate.swift @@ -35,6 +35,41 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele // MARK: NSApplicationDelegate functions func applicationDidFinishLaunching(_: Notification) { + // app did not lauch before + if !Settings.sharedInstance.appLaunchedBefore { + log("[AppDelegate] Opening Welcome Screen") + + DispatchQueue.main.async { + // open welcome screen in next cycle (await LUIInit) + self.openMainWindow() + } + + // user installed the app after the IAP was implemented, set the user as eligible for IAP + Settings.sharedInstance.isEligibleForIap = true + LUIInit(configuration: configuration) + } else { + // app launched before + #if GITHUB + log("[AppDelegate] Downloaded from GitHub.") + #else + // user installed the app before the IAP was implemented, grant the plus version + if !Settings.sharedInstance.isEligibleForIap { + log("[AppDelegate] Granting QuickDrop+ for old user") + UserDefaults.standard.set(true, forKey: Settings.UserDefaultsKeys.plusVersionLegacy.rawValue) + } + #endif + + BezelNotification.show(messageText: "ReadyToReceive".localized(), icon: .receiveIcon) + + // only start receiving immediately for existing user, for new users we want to delay the permission prompt + LUIInit(configuration: configuration) + startReceiving() + } + + UNUserNotificationCenter.current().delegate = self + + + // MARK: Menu Bar let menu = NSMenu() @@ -67,38 +102,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele statusItem?.menu = menu statusItem?.behavior = .removalAllowed - // app did not lauch before - if !Settings.sharedInstance.appLaunchedBefore { - log("[AppDelegate] Opening Welcome Screen") - - DispatchQueue.main.async { - // open welcome screen in next cycle (await LUIInit) - self.openMainWindow() - } - - // user installed the app after the IAP was implemented, set the user as eligible for IAP - Settings.sharedInstance.isEligibleForIap = true - } else { - // app launched before - #if GITHUB - log("[AppDelegate] Downloaded from GitHub.") - #else - // user installed the app before the IAP was implemented, grant the plus version - if !Settings.sharedInstance.isEligibleForIap { - log("[AppDelegate] Granting QuickDrop+ for old user") - UserDefaults.standard.set(true, forKey: Settings.UserDefaultsKeys.plusVersionLegacy.rawValue) - } - #endif - - BezelNotification.show(messageText: "ReadyToReceive".localized(), icon: .receiveIcon) - - // only start receiving immediately for existing user, for new users we want to delay the permission prompt - startReceiving() - } - LUIInit(configuration: configuration) - - UNUserNotificationCenter.current().delegate = self + // MARK: Nearby Connections Callbacks NearbyConnectionManager.shared.connectionUpdateCallback = { isConnected in if isConnected { @@ -115,6 +120,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele self.visibleItem?.title = self.getDefaultVisibleLabel() } + + // MARK: Logging + log("[AppDelegate] Application did finish launching") log("[AppDelegate] Currently running apps: \(NSWorkspace.shared.runningApplications.map { $0.localizedName ?? "-" })") }