fix(ios): downloads not working due to permission errors (#2180)

* Update AppDelegate.swift

store the Documents directory path which the app can then use for downloads instead of trying to create a Downloads directory

* Update Info.plist

should resolve the permission issues because  using Documents directory instead of trying to create a Downloads directory.

---------

Co-authored-by: Kingkor Roy Tirtho <krtirtho@gmail.com>
This commit is contained in:
Malik Miran 2025-01-30 20:50:50 +06:00 committed by GitHub
parent b52bf0f448
commit 2ea8070771
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 2 deletions

View File

@ -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)
}

View File

@ -72,5 +72,11 @@
<array>
<string>_spotube._tcp</string>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>UISupportsDocumentBrowser</key>
<true/>
</dict>
</plist>