import Flutter import UIKit import AntelopSDK @main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GeneratedPluginRegistrant.register(with: self) AntelopAppDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } override func applicationDidBecomeActive(_ application: UIApplication) { AntelopAppDelegate.shared.applicationDidBecomeActive(application) } override func applicationWillTerminate(_ application: UIApplication) { AntelopAppDelegate.shared.applicationWillTerminate(application) } override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { AntelopAppDelegate.shared.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken) // Forward to FlutterAppDelegate so Firebase Messaging can capture the APNs token via swizzling. super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken) } override func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { if AntelopAppDelegate.shared.didReceiveRemoteNotification(userInfo, fetchCompletionHandler: completionHandler) { return } // Forward to FlutterAppDelegate so Firebase Messaging can deliver the notification to Dart. super.application(application, didReceiveRemoteNotification: userInfo, fetchCompletionHandler: completionHandler) } override func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { AntelopAppDelegate.shared.application(application, performFetchWithCompletionHandler: completionHandler) } }