Instance Method

confirm(intent:completion:)

Confirms that you can book the ride.

Declaration

optional func confirm(intent: INRequestRideIntent, completion: @escaping (INRequestRideIntentResponse) -> Void)

Parameters

intent

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

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 INRequestRideIntentResponse object containing the status of whether your app is able to book the ride, along with the ride details you are planning to use during booking. This parameter must not be nil.

Discussion

Implement this method to create a response object with the details that you intend to use when booking the ride. Although you are providing details about how you intend to book the ride, do not actually book the ride from this method. Siri or Maps will present the details of your response to the user. If the user changes any ride properties prior to confirmation, you may have to resolve those properties and confirm the updated request again before handling the booking.

Put as many details as possible in the INRideStatus object you configure with your response object. For more information about configuring the ride status object, see INRideStatus.

Maps may update the pickup location for the ride either before or after calling this method based on user input. Always use the information in the intent parameter to generate your confirmation response.