Instance Method

confirm(cancelRide:completion:)

Confirms that you can cancel the ride.

Declaration

optional func confirm(cancelRide intent: INCancelRideIntent, completion: @escaping (INCancelRideIntentResponse) -> Void)

Parameters

intent

The intent object containing details about the user’s request.

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 INCancelRideIntentResponse object containing the status of whether your app is able to cancel the ride. This parameter must not be nil.

Discussion

Implement this method to create a response object with information about whether you can cancel the ride. If your service charges fees for canceling a ride, include the fee information in your response object. Siri or Maps then presents the details of your response to the user.

If the code in your response is not INCancelRideIntentResponseCode.ready or INCancelRideIntentResponseCode.success, SiriKit aborts the handling of the intent object and falls back to other options. Specifically, if you supplied an NSUserActivity object in the userActivityForCancelingInApplication property of your INRideStatus object when booking the ride, SiriKit delivers that user activity object to your app.