tsacdop-podcast-app-android/ios/Runner/AppDelegate.swift

24 lines
823 B
Swift
Raw Normal View History

2020-02-09 13:29:09 +01:00
import UIKit
import Flutter
2020-05-10 10:56:04 +02:00
import flutter_downloader
2020-02-09 13:29:09 +01:00
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
2020-05-10 10:56:04 +02:00
FlutterDownloaderPlugin.setPluginRegistrantCallback(registerPlugins)
UIApplication.shared.setMinimumBackgroundFetchInterval(TimeInterval(60*60*4))
2020-02-09 13:29:09 +01:00
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
2020-05-10 10:56:04 +02:00
private func registerPlugins(registry: FlutterPluginRegistry) {
if (!registry.hasPlugin("FlutterDownloaderPlugin")) {
FlutterDownloaderPlugin.register(with: registry.registrar(forPlugin: "FlutterDownloaderPlugin"))
}
}