Back to skills
SKILL.md
2564 09 Deviceactivity Scheduling Thresholds And Errors B19c787f
ASecurityDefine schedule/event modeling with explicit limits and error handling requirements.
- 9 stars
- 0 votes
- 0 copies
- 0 views
- Added October 11, 2026
Works with
Security analysis
100/100npx -y skills add tools-only/X-Skills --skill 2564-09-deviceactivity-scheduling-thresholds-and-errors_b19c787f --agent claude-codeAre you the author of 2564 09 Deviceactivity Scheduling Thresholds And Errors B19c787f?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tools-only-2564-09-deviceactivity-scheduling-thresholds-and-e)# 09 DeviceActivity Scheduling Thresholds and Errors
## Purpose
Define schedule/event modeling with explicit limits and error handling requirements.
## Canonical API Surface
- `DeviceActivityCenter.startMonitoring(_:during:events:)`
- `DeviceActivitySchedule`
- `DeviceActivityEvent`
- `DeviceActivityCenter.MonitoringError`
## Implementation Pattern
1. Build schedule windows from deterministic date components.
2. Use named `DeviceActivityName` constants to avoid collisions.
3. Include threshold events only when required.
4. Handle `MonitoringError` with user-visible and telemetry-visible paths.
5. Use fallback schedule when detailed monitor setup fails.
## MonitoringError Handling Matrix
- `.excessiveActivities`: reduce monitor count and consolidate schedules.
- `.intervalTooShort`: enforce minimum 15-minute intervals.
- `.intervalTooLong`: enforce one-week cap for event monitoring intervals.
- `.invalidDateComponents`: validate schedule components before registration.
- `.unauthorized`: request/recover FamilyControls authorization.
## Failure Modes
- Attempting >20 simultaneous monitored activities.
- Non-unique activity names.
- Too granular intervals causing runtime throws.
- Ignoring timezone behavior at interval boundaries.
## Validation Checklist
- [ ] Interval bounds validated pre-registration.
- [ ] Activity names are unique.
- [ ] Start-monitoring exceptions are surfaced and logged.
- [ ] Fallback schedule path tested.
- [ ] Time-zone change scenario tested.
## Sources
- `../evidence/04-deviceactivity-sdk-signatures.md`
- https://developer.apple.com/documentation/deviceactivity/deviceactivitycenter/startmonitoring(_:during:events:)
- https://developer.apple.com/documentation/deviceactivity/deviceactivitycenter/monitoringerror
- https://developer.apple.com/documentation/deviceactivity/deviceactivitycenter/monitoringerror/intervaltooshort
- https://developer.apple.com/documentation/deviceactivity/deviceactivityschedule
- https://developer.apple.com/documentation/deviceactivity/deviceactivityevent
## Confidence Notes
- Limits and errors are `sdk-backed` and reinforced by canonical doc pages.
Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.