2
votes

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?

1
Can you share your userNotificationCenter(_:willPresent:withCompletionHandler:) implementation?Burak Akkaş
@BurakAkkaş All I have is the single line: completionHandler([[.banner, .badge, .sound]])Kacy

1 Answers

2
votes

I think adding .list should do the trick

completionHandler([.badge, .banner, .sound, .list])

You can read more about UNNotificationPresentationOptions here.