<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/AppIntent/needsToContinueInForegroundError(_:alwaysConfirm:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "App Intents",
      "AppIntents"
    ],
    "preciseIdentifier" : "s:10AppIntents0A6IntentPAAE32needsToContinueInForegroundError_13alwaysConfirmAA0acI0VAA0C6DialogVSg_SbtF"
  },
  "title" : "needsToContinueInForegroundError(_:alwaysConfirm:)"
}
-->

# needsToContinueInForegroundError(_:alwaysConfirm:)

Asks the person to continue the intent’s action in the foreground.

```
func needsToContinueInForegroundError(_ dialog: IntentDialog? = nil, alwaysConfirm: Bool = true) -> AppIntentError
```

## Parameters

`dialog`

The localized text you want the system to display or speak to confirm the transition.

`alwaysConfirm`

`true` to ask the person to confirm the transition.
If you specify `false`, the system might not ask for confirmation if it already received
a recent confirmation. It doesn’t ask for confirmation if you recently called a `requestChoice`
or `requestConfirmation` method of your intent, or asked to disambiguate a value. It does
ask for confirmation if your app intent conforms to the [`ProgressReportingIntent`](/documentation/AppIntents/ProgressReportingIntent)
protocol and you didn’t update the progress value recently.

## Discussion

If your intent code encounters an error and needs to continue in the foreground, call this
method to start the transition process. Before calling this method, use the contextual
information in the intent’s [`systemContext`](/documentation/AppIntents/AppIntent/systemContext) property to verify the app can
transition to the foreground. If you call this method and it’s not possible to transition
the app to the foreground, the system throws an [`notAllowed`](/documentation/AppIntents/AppIntentError/Unrecoverable/notAllowed) error.

---

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)