iOS 17 AppIntent and requesting confirmation for widgets

I have a home widget with buttons (new in iOS 17). In order to prevent taking action if the user taps on the widget buttons accidentally, I want to ask the user for confirmation.

It appeared that requestConfirmation be exactly what I needed, but no confirmation view shows up when I invoke this method in the perform function.

I have tried the following:

        try await requestConfirmation(result: .result(dialog: "Are you sure you want to do this?") {
            Image(.mdlsWhite)
        })

and this alternative:

        let confirmed: Bool = try await $name.requestConfirmation(for: self.name,
                                                                         dialog: IntentDialog(stringLiteral: msg))

Neither option work.

I am starting to think that the requestConfirmation is not to be used with Home Widgets.

Is there a better way to handle confirmations for buttons included in a Home Widget?

Post not yet marked as solved Up vote post of RawMean Down vote post of RawMean
851 views

Replies

I'm wrestling with the same. Any response to this?

I'm having seeing the same problem. App Intent executes the 'perform' block without asking the user for confirmation :(

** Edit:

To clarify, we run the AppIntent from a button in a Live Activity Widget and Dynamic Island. It runs the perform block and completely ignores user confirmation in both places.

Did you find any solution for this?