Matthias Nott
10 days ago 3233e3046d8922a6f948e0dbd74216d1943df31b
ios/Runner/AppDelegate.swift
....@@ -43,13 +43,15 @@
4343 super.application(application, didFailToRegisterForRemoteNotificationsWithError: error)
4444 }
4545
46
- // Forward notification presentation (foreground)
46
+ // Suppress push notification display when app is in foreground —
47
+ // the MQTT message handler shows it in-app instead
4748 override func userNotificationCenter(
4849 _ center: UNUserNotificationCenter,
4950 willPresent notification: UNNotification,
5051 withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void
5152 ) {
52
- super.userNotificationCenter(center, willPresent: notification, withCompletionHandler: completionHandler)
53
+ // Don't show banner/sound/badge when app is active — MQTT delivers the message directly
54
+ completionHandler([])
5355 }
5456
5557 // Forward notification tap