Matthias Nott
2026-04-01 f68a986682535dca139515741dd60be26a82edd6
ios/Runner/AppDelegate.swift
....@@ -1,5 +1,6 @@
11 import Flutter
22 import UIKit
3
+import UserNotifications
34
45 @main
56 @objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
....@@ -13,4 +14,37 @@
1314 func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
1415 GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
1516 }
17
+
18
+ // Forward APNs token registration to the push plugin
19
+ override func application(
20
+ _ application: UIApplication,
21
+ didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data
22
+ ) {
23
+ super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
24
+ }
25
+
26
+ override func application(
27
+ _ application: UIApplication,
28
+ didFailToRegisterForRemoteNotificationsWithError error: Error
29
+ ) {
30
+ super.application(application, didFailToRegisterForRemoteNotificationsWithError: error)
31
+ }
32
+
33
+ // Forward notification presentation (foreground)
34
+ override func userNotificationCenter(
35
+ _ center: UNUserNotificationCenter,
36
+ willPresent notification: UNNotification,
37
+ withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void
38
+ ) {
39
+ super.userNotificationCenter(center, willPresent: notification, withCompletionHandler: completionHandler)
40
+ }
41
+
42
+ // Forward notification tap
43
+ override func userNotificationCenter(
44
+ _ center: UNUserNotificationCenter,
45
+ didReceive response: UNNotificationResponse,
46
+ withCompletionHandler completionHandler: @escaping () -> Void
47
+ ) {
48
+ super.userNotificationCenter(center, didReceive: response, withCompletionHandler: completionHandler)
49
+ }
1650 }