Files
sf-app-platform/apps/mobile_app/ios/Runner/AppDelegate.swift

42 lines
2.0 KiB
Swift
Raw Normal View History

2025-11-03 09:23:17 +01:00
import Flutter
import UIKit
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)
AntelopAppDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
2025-11-03 09:23:17 +01:00
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)
}
2025-11-03 09:23:17 +01:00
}