Skip to content

Commit

Permalink
Merge pull request #336 from moneymanagerex/track
Browse files Browse the repository at this point in the history
Associate mmb file with MMEX app via onOpenURL
  • Loading branch information
guanlisheng authored Dec 16, 2024
2 parents f09d4f6 + 168aed2 commit 2a5333b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 60 deletions.
6 changes: 2 additions & 4 deletions MMEX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@
A3462F662C94854800F79145 /* ExportableEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3462F652C94854800F79145 /* ExportableEntity.swift */; };
A3462F6A2C948CDB00F79145 /* ExportableEntityDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3462F692C948CDB00F79145 /* ExportableEntityDocument.swift */; };
A350BDC12CA26415006669D5 /* TransactionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A350BDC02CA26415006669D5 /* TransactionViewModel.swift */; };
A36599042D0FCB0500F506B6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A36599032D0FCB0500F506B6 /* AppDelegate.swift */; };
A379C1A92CA3B9EB00CC8E2C /* AssetListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A379C1A82CA3B9EB00CC8E2C /* AssetListView.swift */; };
A37E7D842C9AC14800B4ECFC /* ManageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A37E7D832C9AC14800B4ECFC /* ManageView.swift */; };
A37E7D862C9AC2D000B4ECFC /* InfoAboutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A37E7D852C9AC2D000B4ECFC /* InfoAboutView.swift */; };
Expand Down Expand Up @@ -408,7 +407,6 @@
A3462F652C94854800F79145 /* ExportableEntity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExportableEntity.swift; sourceTree = "<group>"; };
A3462F692C948CDB00F79145 /* ExportableEntityDocument.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExportableEntityDocument.swift; sourceTree = "<group>"; };
A350BDC02CA26415006669D5 /* TransactionViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionViewModel.swift; sourceTree = "<group>"; };
A36599032D0FCB0500F506B6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
A379C1A82CA3B9EB00CC8E2C /* AssetListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetListView.swift; sourceTree = "<group>"; };
A37E7D832C9AC14800B4ECFC /* ManageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManageView.swift; sourceTree = "<group>"; };
A37E7D852C9AC2D000B4ECFC /* InfoAboutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoAboutView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -496,7 +494,6 @@
929EF6702CA3676B0051A3E6 /* MMEXDocument.swift */,
A3C1425E2C8DE70300D3CEC0 /* MMEXDatabase.swift */,
A3C1422C2C89751500D3CEC0 /* ContentView.swift */,
A36599032D0FCB0500F506B6 /* AppDelegate.swift */,
);
path = App;
sourceTree = "<group>";
Expand Down Expand Up @@ -1155,7 +1152,6 @@
925EABB22CCFFC2E003CEAB3 /* Reload.swift in Sources */,
A337428A2CA8E72C00698466 /* InsightsSummary.swift in Sources */,
A3C142672C8F2AF500D3CEC0 /* TransactionData.swift in Sources */,
A36599042D0FCB0500F506B6 /* AppDelegate.swift in Sources */,
925EAC0F2CDA8B1A003CEAB3 /* TagSearch.swift in Sources */,
92F686032CF0EE7700171A6A /* BudgetSearch.swift in Sources */,
925EAC202CDAADFB003CEAB3 /* AttachmentValidation.swift in Sources */,
Expand Down Expand Up @@ -1460,6 +1456,7 @@
INFOPLIST_KEY_CFBundleDisplayName = MMEX;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
Expand Down Expand Up @@ -1495,6 +1492,7 @@
INFOPLIST_KEY_CFBundleDisplayName = MMEX;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
Expand Down
42 changes: 0 additions & 42 deletions MMEX/App/AppDelegate.swift

This file was deleted.

9 changes: 2 additions & 7 deletions MMEX/App/MMEXApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ let log = Logger(

@main
struct MMEXApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
@StateObject private var pref = Preference()
@StateObject private var vm = ViewModel(withStoredDatabase: ())

Expand All @@ -43,12 +42,8 @@ struct MMEXApp: App {
track(pref: pref)
}
.handlesExternalEvents(preferring: Set(["mmb"]), allowing: Set(["*"]))
.onReceive(NotificationCenter.default.publisher(for: Notification.Name("MMEXOpenFile"))) { notification in
log.debug("DEBUG: onReceive")
if let url = notification.object as? URL {
log.debug("File URL received in SwiftUI: \(url.path)")
// vm.openDatabase(at: url) // Example: Replace with your actual ViewModel logic
}
.onOpenURL { url in
vm.openDatabase(at: url)
}
.environmentObject(pref)
.environmentObject(vm)
Expand Down
7 changes: 0 additions & 7 deletions MMEX/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@
</array>
</dict>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict/>
</dict>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
Expand Down

0 comments on commit 2a5333b

Please sign in to comment.