Merge pull request #2 from malikmiran/patch-1

Update AppDelegate.swift
This commit is contained in:
Malik Miran 2024-12-24 18:35:05 +06:00 committed by GitHub
commit f31fc8f5f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,12 +1,17 @@
import UIKit import UIKit
import Flutter import Flutter
@main @UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate { @objc class AppDelegate: FlutterAppDelegate {
override func application( override func application(
_ application: UIApplication, _ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool { ) -> 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) GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions) return super.application(application, didFinishLaunchingWithOptions: launchOptions)
} }