Closed Supereg closed 1 month ago
Attention: Patch coverage is 69.77153%
with 344 lines
in your changes missing coverage. Please review.
Project coverage is 70.60%. Comparing base (
afb9193
) to head (5d5fee9
). Report is 1 commits behind head on main.
Support for scheduling notifications
:recycle: Current situation & Problem
The newly introduced SpeziScheduler #44 didn't include support for notifications (see #45). This PR adds back this feature, providing several improvements over the previous implementation. A core challenge is that Apple limits the amount of locally scheduled notifications to 64 request at a time. Therefore, we optimize scheduling by applying the overall rules:
30
notification at a time and never earlier than 1 month in advance to ensure other modules are still able to schedule local notifications. These settings can be adjusted by manually configuring theSchedulerNotifications
in yourSpeziAppDelegate
:gear: Release Notes
daily
andweekly
shorthand initializes of aSchedule
) and prioritizes event notifications by their occurrence date.allDay
.SchedulerNotificationsConstraint
.notificationPresentation
option).automaticallyRequestProvisionalAuthorization
option).:books: Documentation
Added a dedicated configuration section around notifications in the documentation catalog. The documentation of the
SchedulerNotifications
module highlights the necessary steps to set up notifications for your project.:white_check_mark: Testing
Added the
XCTSpeziScheduler
target that provide UI components to visualize scheduled notification requests. We use this in the UI tests to verify that notifications are scheduled as expected. The Test App schedules a repeating daily notification that has its first occurrence 40s after app launch. Additionally we schedule a daily repeating task that starts 1 week after initial app launch to test event-level scheduling.:pencil: Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: