---
title: WKExtendedRuntimeSessionErrorCode.mustBeActiveToStartOrSchedule
framework: watchkit
role: symbol
role_heading: Case
path: watchkit/wkextendedruntimesessionerrorcode/mustbeactivetostartorschedule
---

# WKExtendedRuntimeSessionErrorCode.mustBeActiveToStartOrSchedule

The watchOS app attempted to start or schedule a session while not in an active state.

## Declaration

```swift
case mustBeActiveToStartOrSchedule
```

## Discussion

Discussion You can only start or schedule sessions when the watchOS app is running in the foreground. Specifically, the WatchKit extension’s applicationState must equal WKApplicationState.active.

## See Also

### Error Codes

- [WKExtendedRuntimeSessionErrorCode.unknown](watchkit/wkextendedruntimesessionerrorcode/unknown.md)
- [WKExtendedRuntimeSessionErrorCode.scheduledTooFarInAdvance](watchkit/wkextendedruntimesessionerrorcode/scheduledtoofarinadvance.md)
- [WKExtendedRuntimeSessionErrorCode.notYetStarted](watchkit/wkextendedruntimesessionerrorcode/notyetstarted.md)
- [WKExtendedRuntimeSessionErrorCode.exceededResourceLimits](watchkit/wkextendedruntimesessionerrorcode/exceededresourcelimits.md)
- [WKExtendedRuntimeSessionErrorCode.barDisabled](watchkit/wkextendedruntimesessionerrorcode/bardisabled.md)
- [WKExtendedRuntimeSessionErrorCode.notApprovedToStartSession](watchkit/wkextendedruntimesessionerrorcode/notapprovedtostartsession.md)
- [WKExtendedRuntimeSessionErrorCode.notApprovedToSchedule](watchkit/wkextendedruntimesessionerrorcode/notapprovedtoschedule.md)
