<!--
{
  "availability" : [
    "iOS: 16.4.0 - 26.0.0",
    "iOSAppExtension: -",
    "iPadOS: 16.4.0 - 26.0.0",
    "macCatalyst: -",
    "macCatalystAppExtension: -",
    "macOS: 13.3.0 - 26.0.0",
    "macOSAppExtension: -",
    "tvOS: 16.4.0 - 26.0.0",
    "tvOSAppExtension: -",
    "visionOS: -",
    "watchOS: 9.4.0 - 26.0.0",
    "watchOSAppExtension: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/ForegroundContinuableIntent/needsToContinueInForegroundError(_:continuation:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "App Intents",
      "AppIntents"
    ],
    "preciseIdentifier" : "s:10AppIntents27ForegroundContinuableIntentPAAE017needsToContinueInC5Error_12continuationAA0aeJ0VAA0E6DialogVSg_yyYaKScMYccSgtF"
  },
  "title" : "needsToContinueInForegroundError(_:continuation:)"
}
-->

# needsToContinueInForegroundError(_:continuation:)

A method you call to ask a person to continue an intent’s action in the foreground after it encounters an error.

```
func needsToContinueInForegroundError(_ dialog: IntentDialog? = nil, continuation: (@MainActor () async throws -> Void)? = nil) -> AppIntentError
```

## Discussion

Call this method when you need to stop performing the app intent and
ask a person to continue execution in the foreground. Provide an optional continuation closure that
runs on the main thread to update your app’s state after the person permits the action to continue in the foreground.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)