I am using silent notifications for the purpose of notifying my app when new content is available. With iOS 11.0 to iOS 11.1, the silent notifications rarely get delivered to the app on background. However, I would want to at least process the silent notifications when the app becomes active again.
I did not find a way to get a list of the silent notifications. I have tried:
let center = UNUserNotificationCenter.current()
center.getPendingNotificationRequests(completionHandler: { (notifications) in
notifications.forEach({ (notification) in
print(notification)
})
})
center.getDeliveredNotifications { (notifications) in
notifications.forEach({ (notification) in
print(notification)
})
}
I know that the notifications are received by the phone because I have checked the device logs. However, they do not seem to be forwarded to the app even when it becomes active. Is there a way to access them?