Skip to content
Back to skills

2564 09 Deviceactivity Scheduling Thresholds And Errors B19c787f

ASecurity

Define schedule/event modeling with explicit limits and error handling requirements.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
developmentapidocumentation

Works with

  • api

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2564-09-deviceactivity-scheduling-thresholds-and-errors_b19c787f --agent claude-code

Installs into .claude/skills of the current project.

Are 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.

Security grade badge for 2564 09 Deviceactivity Scheduling Thresholds And Errors B19c787f
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2564-09-deviceactivity-scheduling-thresholds-and-e/badge)](https://www.skillsdirectory.com/skills/tools-only-2564-09-deviceactivity-scheduling-thresholds-and-e)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# 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

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.