I am trying to get list of local notifications for my app that are in the notification center so I can display these in the app.
I found this code in this SO answer but it is in Swift. Can anyone translate to Objective-C or suggest how to get the notifications that have fired but are pending in Objective-C?
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().getPendingNotificationRequests { (requests) in
print("here are the iOS 10 notifs \(requests)")
}
} else {
let requests = (UIApplication.shared.scheduledLocalNotifications ?? [])
print("here are the NON iOS 10 notifs \(requests)")
}