2026-03-13 09:38:21 -05:00
|
|
|
import native_video_player
|
2022-02-03 10:06:44 -06:00
|
|
|
|
2024-08-15 14:53:37 -05:00
|
|
|
@main
|
2026-04-16 22:26:46 +05:30
|
|
|
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
|
2022-02-03 10:06:44 -06:00
|
|
|
override func application(
|
|
|
|
|
_ application: UIApplication,
|
|
|
|
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
|
|
|
|
) -> Bool {
|
2024-12-05 02:33:46 +05:30
|
|
|
// Required for flutter_local_notification
|
|
|
|
|
if #available(iOS 10.0, *) {
|
2026-02-05 12:42:53 -05:00
|
|
|
UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
|
2024-12-05 02:33:46 +05:30
|
|
|
}
|
|
|
|
|
|
2026-03-13 09:38:21 -05:00
|
|
|
SwiftNativeVideoPlayerPlugin.cookieStorage = URLSessionManager.cookieStorage
|
2026-03-13 22:23:07 -05:00
|
|
|
URLSessionManager.patchBackgroundDownloader()
|
2025-09-03 02:05:58 +05:30
|
|
|
BackgroundWorkerApiImpl.registerBackgroundWorkers()
|
2024-12-05 02:33:46 +05:30
|
|
|
|
|
|
|
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
2022-02-03 10:06:44 -06:00
|
|
|
}
|
2026-04-16 22:26:46 +05:30
|
|
|
|
|
|
|
|
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
|
|
|
|
|
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
|
|
|
|
|
let messenger = engineBridge.applicationRegistrar.messenger()
|
|
|
|
|
AppDelegate.registerPlugins(with: engineBridge.pluginRegistry, messenger: messenger)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static func registerPlugins(with registry: FlutterPluginRegistry, messenger: FlutterBinaryMessenger) {
|
|
|
|
|
NativeSyncApiImpl.register(with: registry.registrar(forPlugin: NativeSyncApiImpl.name)!)
|
2026-05-22 15:10:11 +03:00
|
|
|
PermissionApiSetup.setUp(binaryMessenger: messenger, api: PermissionApiImpl())
|
2026-04-16 22:26:46 +05:30
|
|
|
LocalImageApiSetup.setUp(binaryMessenger: messenger, api: LocalImageApiImpl())
|
|
|
|
|
RemoteImageApiSetup.setUp(binaryMessenger: messenger, api: RemoteImageApiImpl())
|
|
|
|
|
BackgroundWorkerFgHostApiSetup.setUp(binaryMessenger: messenger, api: BackgroundWorkerApiImpl())
|
|
|
|
|
ConnectivityApiSetup.setUp(binaryMessenger: messenger, api: ConnectivityApiImpl())
|
|
|
|
|
NetworkApiSetup.setUp(binaryMessenger: messenger, api: NetworkApiImpl())
|
2025-10-14 07:39:12 +05:30
|
|
|
}
|
2026-04-16 22:26:46 +05:30
|
|
|
|
2025-10-14 07:39:12 +05:30
|
|
|
public static func cancelPlugins(with engine: FlutterEngine) {
|
|
|
|
|
(engine.valuePublished(byPlugin: NativeSyncApiImpl.name) as? NativeSyncApiImpl)?.detachFromEngine()
|
2025-08-28 19:41:54 +05:30
|
|
|
}
|
2022-02-03 10:06:44 -06:00
|
|
|
}
|