2025-11-03 09:23:17 +01:00
|
|
|
import Flutter
|
|
|
|
|
import UIKit
|
2026-02-26 14:59:51 +01:00
|
|
|
import AntelopSDK
|
2025-11-03 09:23:17 +01:00
|
|
|
|
|
|
|
|
@main
|
|
|
|
|
@objc class AppDelegate: FlutterAppDelegate {
|
|
|
|
|
override func application(
|
|
|
|
|
_ application: UIApplication,
|
|
|
|
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
|
|
|
|
) -> Bool {
|
|
|
|
|
GeneratedPluginRegistrant.register(with: self)
|
2026-02-26 14:59:51 +01:00
|
|
|
AntelopAppDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
|
2025-11-03 09:23:17 +01:00
|
|
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
|
|
|
|
}
|
2026-02-26 14:59:51 +01:00
|
|
|
|
|
|
|
|
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)
|
2026-04-07 03:31:09 +02:00
|
|
|
// Forward to FlutterAppDelegate so Firebase Messaging can capture the APNs token via swizzling.
|
|
|
|
|
super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
|
2026-02-26 14:59:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
|
2026-04-07 03:31:09 +02:00
|
|
|
if AntelopAppDelegate.shared.didReceiveRemoteNotification(userInfo, fetchCompletionHandler: completionHandler) {
|
2026-02-26 14:59:51 +01:00
|
|
|
return
|
|
|
|
|
}
|
2026-04-07 03:31:09 +02:00
|
|
|
// Forward to FlutterAppDelegate so Firebase Messaging can deliver the notification to Dart.
|
|
|
|
|
super.application(application, didReceiveRemoteNotification: userInfo, fetchCompletionHandler: completionHandler)
|
2026-02-26 14:59:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
|
|
|
|
|
AntelopAppDelegate.shared.application(application, performFetchWithCompletionHandler: completionHandler)
|
|
|
|
|
}
|
2025-11-03 09:23:17 +01:00
|
|
|
}
|