Contents

confirm(intent:completion:)

Confirms whether you can perform the search.

Declaration

optional func confirm(intent: INSearchForBillsIntent, completion: @escaping  @Sendable (INSearchForBillsIntentResponse) -> Void)
optional func confirm(intent: INSearchForBillsIntent) async -> INSearchForBillsIntentResponse

Parameters

  • intent:

    The intent object containing details about the user’s request. Your handler object has already resolved the information in this object.

  • completion:

    The handler block to execute with your response. You must execute this handler at some point during your implementation of this method. The handler has no return value and takes the following parameter:

    response

    The Insearchforbillsintentresponse object containing the details to confirm with the user. This parameter must not be nil.

Discussion

Implement this method to validate that you can perform the search using the given parameters, but don’t perform the search yet. If the search involves contacting a remote server, you should also validate that the server is available. At some point in your implementation, execute the provided completion block with a response object indicating your app’s readiness to perform the search.