From 94f6157e0e3eb59b498507cb8e98a9ad5a242b41 Mon Sep 17 00:00:00 2001
From: Malik Miran <76216906+malikmiran@users.noreply.github.com>
Date: Tue, 24 Dec 2024 18:19:03 +0600
Subject: [PATCH 1/2] Update AppDelegate.swift
store the Documents directory path which the app can then use for downloads instead of trying to create a Downloads directory
---
ios/Runner/AppDelegate.swift | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift
index b6363034..f512ac86 100644
--- a/ios/Runner/AppDelegate.swift
+++ b/ios/Runner/AppDelegate.swift
@@ -1,12 +1,17 @@
import UIKit
import Flutter
-@main
+@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
+ // Add this to get Documents directory path
+ if let documentsPath = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first?.path {
+ UserDefaults.standard.set(documentsPath, forKey: "download_path")
+ }
+
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
From d2481e4e4b932778256fbbecb580d42ea6adcc8d Mon Sep 17 00:00:00 2001
From: Malik Miran <76216906+malikmiran@users.noreply.github.com>
Date: Tue, 24 Dec 2024 18:29:23 +0600
Subject: [PATCH 2/2] Update Info.plist
should resolve the permission issues because using Documents directory instead of trying to create a Downloads directory.
---
ios/Runner/Info.plist | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index ffd511a4..91b7ad94 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -72,5 +72,11 @@
_spotube._tcp
+ UIFileSharingEnabled
+
+ LSSupportsOpeningDocumentsInPlace
+
+ UISupportsDocumentBrowser
+
-
\ No newline at end of file
+