iOS: show transfer notifications as banners while the app is open

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Ayushya Amitabh
2026-10-07 23:13:49 -04:00
co-authored by Claude Sonnet 5.5
parent 6a1d0eb23e
commit 870ca8ea17
+15 -1
View File
@@ -1,5 +1,6 @@
import Flutter
import UIKit
import UserNotifications
@main
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
@@ -8,7 +9,20 @@ import UIKit
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
TransferManager.shared.reconnect()
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
let launched = super.application(application, didFinishLaunchingWithOptions: launchOptions)
UNUserNotificationCenter.current().delegate = self
return launched
}
/// A transfer summary ("Downloaded 1 file") usually finishes while the app
/// is open; without this iOS delivers it silently to Notification Center
/// instead of showing the banner.
override func userNotificationCenter(
_ center: UNUserNotificationCenter,
willPresent notification: UNNotification,
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void
) {
completionHandler([.banner, .list, .sound])
}
override func application(