28 lines
930 B
Swift
28 lines
930 B
Swift
import Flutter
|
|
import UIKit
|
|
import MapLibre
|
|
|
|
@main
|
|
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
|
|
override func application(
|
|
_ application: UIApplication,
|
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
|
) -> Bool {
|
|
// Increase Ambient Cache Size to 5GB (5 * 1024 * 1024 * 1024 bytes)
|
|
// This allows the app to store more map tiles locally after the first fetch.
|
|
Task {
|
|
do {
|
|
try await MLNOfflineStorage.shared.setMaximumAmbientCacheSize(5368709120)
|
|
} catch {
|
|
NSLog("Failed to set ambient cache size: %s", String(describing: error))
|
|
}
|
|
}
|
|
|
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
|
}
|
|
|
|
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
|
|
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
|
|
}
|
|
}
|