Instance Method

handle(intent:completion:)

Handles the booking of the ride.

Required.

Declaration

func handle(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 and confirmed 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 details of the booked ride. This parameter must not be nil.

Discussion

Your implementation of this method must book the requested ride using the data in the intent parameter, configure a response object with the details of the booking, and call the provided completion block. When configuring your response object, use the rideStatus property to specify an INRideStatus object with the details of the ride. A ride status object contains information about the vehicle and driver that are picking up the user’s party, the pickup and drop-off locations, the price of the ride, and whether the booking request was successful. For more information about configuring this object, see INRideStatus.