RelevanceKit
Use RelevanceKit to tell the Apple Watch Smart Stack when a widget matters by
time, location, fitness state, sleep schedule, or connected hardware. Targets
Swift 6.3 and watchOS 26+ relevant-widget workflows.
Beta-sensitive. Re-check current Apple documentation before changing
availability, signatures, or Smart Stack behavior.
Contents
Choose a provider
Use one of two models:
- Add
relevance() to an existing AppIntentTimelineProvider when the widget
always has timeline content and relevance is supplementary.
- Use
RelevanceConfiguration with a RelevanceEntriesProvider when the
widget should appear only under matching conditions or create multiple
relevant cards. This path is watchOS 26+.
Read RelevanceKit patterns for complete
providers, every RelevantContext factory, permissions, grouping,
associatedKind, previews, and RelevantIntentManager updates.
RelevantContext is declared across Apple platforms, but its relevance effect
is watchOS-only. Shared provider code may compile elsewhere without changing
widget visibility there.
Scope boundaries
Keep this skill focused on RelevantContext, WidgetRelevanceAttribute,
provider relevance(), RelevanceConfiguration, grouping,
RelevantIntentManager, and permissions required by relevance clues.
Route these sibling concerns elsewhere:
- Widget timelines, families, reload budgets, rendering, push reloads, Live
Activities, and controls →
widgetkit.
- Workout sessions, activity/sleep queries, routes, and HealthKit authorization
UX →
healthkit.
- Geocoding, place search, directions, regions, geofencing, and location
authorization architecture →
mapkit.
Signals and permissions
| Context |
Use |
Required setup |
.date(...) |
Moment, scheduled event, or date interval |
None |
.location(inferred:) |
Home, work, school, commute |
App location permission plus NSWidgetWantsLocation |
.location(_:) |
Specific CLRegion |
Same location setup |
.location(category:) |
Nearby point-of-interest category |
Same setup; returns optional |
.fitness(.workoutActive) |
Active workout |
HealthKit read access to HKWorkoutType |
.fitness(.activityRingsIncomplete) |
Ring progress |
Exact exercise/move/stand read types |
.sleep(...) |
Bedtime or wakeup |
Sleep-analysis read access |
.hardware(headphones:) |
Headphone connection |
None |
Location purpose strings belong in the containing app. The widget extension
declares NSWidgetWantsLocation and checks
CLLocationManager.isAuthorizedForWidgetUpdates. Enable HealthKit and request
the exact read types in every target that supplies fitness or sleep relevance.
Provider invariants
- Return
WidgetRelevanceAttribute values in priority order; the system may use
only a subset.
location(category:) is optional—omit unsupported categories rather than
force-unwrapping.
- A relevance entries provider supplies
relevance, entry, placeholder,
and a deterministic preview path.
- When timeline and relevant widgets represent the same data, set
.associatedKind(_:) to avoid duplicate Smart Stack cards.
- Use
.automatic, .ungrouped, or .named grouping intentionally.
- For timeline-provider relevance, call
RelevantIntentManager.shared.updateRelevantIntents whenever source data
changes, not only during timeline refresh.
- Degrade gracefully when authorization is absent; do not manufacture false
location, fitness, or sleep clues.
Testing
- Enable WidgetKit Developer Mode on the Apple Watch.
- Preview entry and configuration states at relevant display sizes.
- Exercise permission granted, denied, restricted, and unavailable data paths.
- Verify ordering, grouping, and duplicate suppression with realistic entries.
- Finish on a physical watch; do not treat compilation or iOS preview behavior
as proof of Smart Stack ranking.
Common Mistakes
- Expecting RelevanceKit calls to affect iOS widget ranking.
- Creating a relevant widget when a normal timeline plus relevance is sufficient.
- Returning location clues without widget-update authorization.
- Failing to refresh relevant intents after source data changes.
- Omitting
associatedKind and creating duplicate cards.
- Assuming every point-of-interest category creates a context.
Review Checklist
References
1---2name: relevancekit3description: Increase widget visibility on Apple Watch using RelevanceKit. Use when providing contextual relevance signals for watchOS widgets, declaring time-based or location-based relevance, combining multiple relevance providers, helping the system surface the right widget at the right time on watchOS 26, or routing mixed RelevanceKit/WidgetKit/HealthKit/MapKit Smart Stack scope.4---56# RelevanceKit78Use RelevanceKit to tell the Apple Watch Smart Stack when a widget matters by9time, location, fitness state, sleep schedule, or connected hardware. Targets10Swift 6.3 and watchOS 26+ relevant-widget workflows.1112> **Beta-sensitive.** Re-check current Apple documentation before changing13> availability, signatures, or Smart Stack behavior.1415## Contents1617- [Choose a provider](#choose-a-provider)18- [Scope boundaries](#scope-boundaries)19- [Signals and permissions](#signals-and-permissions)20- [Provider invariants](#provider-invariants)21- [Testing](#testing)22- [Common mistakes](#common-mistakes)23- [Review checklist](#review-checklist)24- [References](#references)2526## Choose a provider2728Use one of two models:29301. Add `relevance()` to an existing `AppIntentTimelineProvider` when the widget31 always has timeline content and relevance is supplementary.322. Use `RelevanceConfiguration` with a `RelevanceEntriesProvider` when the33 widget should appear only under matching conditions or create multiple34 relevant cards. This path is watchOS 26+.3536Read [RelevanceKit patterns](references/relevancekit-patterns.md) for complete37providers, every `RelevantContext` factory, permissions, grouping,38`associatedKind`, previews, and `RelevantIntentManager` updates.3940`RelevantContext` is declared across Apple platforms, but its relevance effect41is watchOS-only. Shared provider code may compile elsewhere without changing42widget visibility there.4344## Scope boundaries4546Keep this skill focused on `RelevantContext`, `WidgetRelevanceAttribute`,47provider `relevance()`, `RelevanceConfiguration`, grouping,48`RelevantIntentManager`, and permissions required by relevance clues.4950Route these sibling concerns elsewhere:5152- Widget timelines, families, reload budgets, rendering, push reloads, Live53 Activities, and controls → `widgetkit`.54- Workout sessions, activity/sleep queries, routes, and HealthKit authorization55 UX → `healthkit`.56- Geocoding, place search, directions, regions, geofencing, and location57 authorization architecture → `mapkit`.5859## Signals and permissions6061| Context | Use | Required setup |62|---|---|---|63| `.date(...)` | Moment, scheduled event, or date interval | None |64| `.location(inferred:)` | Home, work, school, commute | App location permission plus `NSWidgetWantsLocation` |65| `.location(_:)` | Specific `CLRegion` | Same location setup |66| `.location(category:)` | Nearby point-of-interest category | Same setup; returns optional |67| `.fitness(.workoutActive)` | Active workout | HealthKit read access to `HKWorkoutType` |68| `.fitness(.activityRingsIncomplete)` | Ring progress | Exact exercise/move/stand read types |69| `.sleep(...)` | Bedtime or wakeup | Sleep-analysis read access |70| `.hardware(headphones:)` | Headphone connection | None |7172Location purpose strings belong in the containing app. The widget extension73declares `NSWidgetWantsLocation` and checks74`CLLocationManager.isAuthorizedForWidgetUpdates`. Enable HealthKit and request75the exact read types in every target that supplies fitness or sleep relevance.7677## Provider invariants7879- Return `WidgetRelevanceAttribute` values in priority order; the system may use80 only a subset.81- `location(category:)` is optional—omit unsupported categories rather than82 force-unwrapping.83- A relevance entries provider supplies `relevance`, `entry`, `placeholder`,84 and a deterministic preview path.85- When timeline and relevant widgets represent the same data, set86 `.associatedKind(_:)` to avoid duplicate Smart Stack cards.87- Use `.automatic`, `.ungrouped`, or `.named` grouping intentionally.88- For timeline-provider relevance, call89 `RelevantIntentManager.shared.updateRelevantIntents` whenever source data90 changes, not only during timeline refresh.91- Degrade gracefully when authorization is absent; do not manufacture false92 location, fitness, or sleep clues.9394## Testing9596- Enable WidgetKit Developer Mode on the Apple Watch.97- Preview entry and configuration states at relevant display sizes.98- Exercise permission granted, denied, restricted, and unavailable data paths.99- Verify ordering, grouping, and duplicate suppression with realistic entries.100- Finish on a physical watch; do not treat compilation or iOS preview behavior101 as proof of Smart Stack ranking.102103## Common Mistakes104105- Expecting RelevanceKit calls to affect iOS widget ranking.106- Creating a relevant widget when a normal timeline plus relevance is sufficient.107- Returning location clues without widget-update authorization.108- Failing to refresh relevant intents after source data changes.109- Omitting `associatedKind` and creating duplicate cards.110- Assuming every point-of-interest category creates a context.111112## Review Checklist113114- [ ] Provider model matches always-available versus condition-only content.115- [ ] Relevance scope is separated from WidgetKit, HealthKit, and MapKit ownership.116- [ ] Every clue has its exact permission and availability setup.117- [ ] Attributes are priority-ordered and unsupported optionals are omitted.118- [ ] Entry, placeholder, relevance, and preview paths are deterministic.119- [ ] Grouping and `associatedKind` prevent unwanted duplicates.120- [ ] Relevant intents update whenever underlying data changes.121- [ ] Physical-watch testing covers permission and ranking behavior.122123## References124125- [RelevanceKit patterns](references/relevancekit-patterns.md)126- [RelevanceKit documentation](https://sosumi.ai/documentation/relevancekit)127- [RelevantContext](https://sosumi.ai/documentation/relevancekit/relevantcontext)128- [Smart Stack widget suggestions](https://sosumi.ai/documentation/widgetkit/widget-suggestions-in-smart-stacks)129- [RelevanceConfiguration](https://sosumi.ai/documentation/widgetkit/relevanceconfiguration)130- [RelevanceEntriesProvider](https://sosumi.ai/documentation/widgetkit/relevanceentriesprovider)