When my app in in the foreground, it receives a push notification from my server, triggers my UNNotificationServiceExtension
, and then triggers userNotificationCenter(_:willPresent:withCompletionHandler:)
. The notification appears at the top of the app for a couple seconds, but when I swipe the top of the phone to see the notification center, the notification isn't there.
If my phone is locked or the app is in the background while I receive the notification, then it does appear in the notification center.
How do I make the notification appear in the notification center while the app is in the foreground?
completionHandler([[.banner, .badge, .sound]])
– Fallacy