continueInForeground(_:alwaysConfirm:)
Attempts to transition the app to the foreground after optionally requesting permission to do so.
Declaration
func continueInForeground(_ dialog: IntentDialog? = nil, alwaysConfirm: Bool = true) async throwsParameters
- dialog:
The localized text you want the system to display or speak to confirm the transition.
- alwaysConfirm:
trueto ask the person to confirm the transition. If you specifyfalse, the system might not ask for confirmation if it already received a recent confirmation. It doesn’t ask for confirmation if you recently called arequestChoiceorrequestConfirmationmethod of your intent, or asked to disambiguate a value. It does ask for confirmation if your app intent conforms to the Progressreportingintent protocol but didn’t update the progress value recently.
Discussion
Call this method from your app intent’s perform() method when you want to continue running your code in the foreground. Before calling this method, use the contextual information in the intent’s 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 error.