Instance Method

handle(intent:completion:)

Handles searching the user’s call history.

Required.

Declaration

func handle(intent: INSearchCallHistoryIntent, completion: @escaping (INSearchCallHistoryIntentResponse) -> Void)

Parameters

intent

The intent object containing details about the user’s request. The information in this object has already been resolved and confirmed by the user.

completion

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

response

The INSearchCallHistoryIntentResponse object containing the status of the request. This parameter must not be nil.

Discussion

Implement this method to search the user’s call history for entries matching the specified parameters. If the search yields results, make a note of those results and prepare to have your app display them. For example, you could include the results in the NSUserActivity object that you create with your response object.

At the end of your implementation, execute the block in the completion parameter, passing it a response object that encapsulates whether the search was successful.