Hi. I'm looking to schedule a number of notifications based on the user's location and have them be triggered UNLocationNotificationTrigger
s. I want to know whether notifications get delivered so I can limit the number of notifications the user receives in a day. I was hoping I could determine their delivery by either the UNUserNotificationCenterDelegate
's method userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse)
(which only knows when the user has tapped on the notification or deleted it) or by UNUserNotificationCenter.current().deliveredNotifications()
(which should return the notification if it was delivered and is in the Notification Center).
UNUserNotificationCenter.current().deliveredNotifications()
is not returning notifications that were delivered via UNLocationNotificationTrigger
s. I'm assuming this is for some privacy reason? All of the UNLocationNotificationTrigger
s are configured with notifyOnEntry
to be true
, notifyOnExit
to be false
, and repeats
to be false
. They get delivered appropriately, but I can't determine if/when they get delivered to ensure the user doesn't receive too many notifications. Notifications delivered with a UNTimeIntervalNotificationTrigger
are returned as expected.
Is all of this by design or is there another way to determine when a notification scheduled with a UNLocationNotificationTrigger
gets delivered? I'm just trying to create the best experience for my users. Thank you.