ScheduledNotificationsViewController
ScheduledNotificationsViewController shows you all of your pending local notifications in one place, with all the information you need. Tapping on a notification will immediately trigger its delivery, making this small tool invaluable for debugging local notifications.
Medium story here.
Scheduled | Delivered | Tap to trigger |
---|---|---|
Features
- See all scheduled notifications in one place: every notification includes content, next trigger date, an identifier and a category name.
- Tap on a notification in a list to immediately trigger its delivery (you can test live how the notification will look). The "real" notification will still arrive in time!
- Scroll down to see recently delivered notifications (tap "Show Delivered Notifications")
- Supports light and dark mode natively
Usage
import UIKit
import ScheduledNotificationsViewController
// ...somewhere in "Settings" screen:
#if DEBUG
let notificationsVC = ScheduledNotificationsViewController()
self.navigationController?.pushViewController(notificationsVC, animated: true)
#endif
Troubleshooting
Q: My scheduled notifications list is empty
A: Make sure you have granted notifications permissions to your app on your device. More here: ο£Ώ Asking Permission to Use Notifications
Q: I tap on a notification in a list, but nothing shows up
A: Make sure you're using userNotificationCenter(_:willPresent:withCompletionHandler:)
callback in your UNUserNotificationCenterDelegate
. More here: ο£Ώ Handling Notifications and Notification-Related Actions (see section "Handle Notifications While Your App Runs in the Foreground")
Installation
Swift Package Manager
- Click File β Swift Packages β Add Package Dependency.
- Enter
http://github.com/nicephoton/ScheduledNotificationsViewController.git
.