Basically, I\'m simply trying to print the notifications that my app has delivered, but doing something like:
UNUserNotificationCenter.current().getDeliveredNoti
I did face the same problem with getDeliveredNotification, the array of notifications were always empty.
So, I realized that I was setting [UIApplication sharedApplication].applicationBadgeNumber to 0, what clear all remote notifications from notification center.
Now I set applicationBadgeNumber to 0 only after I get all pending notifications.