mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-09-13 13:08:56 +02:00
28 lines
1.1 KiB
Swift
28 lines
1.1 KiB
Swift
import Flutter
|
|
import UIKit
|
|
import UserNotifications
|
|
|
|
@main
|
|
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
|
|
override func application(
|
|
_ application: UIApplication,
|
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
|
) -> Bool {
|
|
// Required by flutter_local_notifications: the plugin implements
|
|
// userNotificationCenter(_:willPresent:withCompletionHandler:), which is
|
|
// what allows a notification to appear while the app is in the foreground.
|
|
// iOS only calls it on the registered delegate, and the plugin does not
|
|
// register itself — without this line, foreground notifications are
|
|
// silently suppressed by the system.
|
|
if #available(iOS 10.0, *) {
|
|
UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
|
|
}
|
|
|
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
|
}
|
|
|
|
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
|
|
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
|
|
}
|
|
}
|