Generate ride options for Maps to display to the user.
When the user selects Ride as the transportation option, Maps sends an
INList object to any Intents app extensions that support the intent. In your response to that intent, provide one or more
INRide objects representing the rides you are able to offer. Keep your list of rides reasonably short and representative of the types of vehicles and price points that you have available. Do not return an exhaustive list of all vehicles available to pick up the user.
For each ride option, include as much information as possible about the ride, including its pricing, passenger capacity, disclaimers, and an estimated time at which a vehicle of that type could arrive at the user’s location. Make the information as accurate as possible, but understand that you can the information when actually booking the ride. Here are some tips to creating your
Give each ride option a unique, localized name. Ride option names should convey information about the ride type and be unique so that you can identify them later. When the user selects a ride option for booking, SiriKit passes only the option name back to you. So you must be able to identify the ride type from that string.
Configure the party size options when party size determines pricing. If the number of people receiving a ride determines the price, configure the
Party Size Options
availableproperties appropriately. Use your
Party Size Options Selection Prompt
INRideobjects to specify the pricing information for parties of different sizes.
Party Size Option
Use fare line items to enumerate individual costs. When the cost of a ride is not a single fixed value, provide fare line items so that the user understands how the app computed the fare. Line items can include base charges, per-mile charges, additional fees or tolls, and discounts.
Include an expiration date. Expiration dates prevent your ride options from becoming stale or outdated. When a ride option expires, SiriKit sends another
INListobject to your Intents extension.
Ride Options Intent
If your app must complete the booking, provide an appropriate user activity object. You might complete the booking in your app when special circumstances apply, such as when you need to change the precise pickup or drop-off location. Assigning an
NSUserobject to the
userproperty of the
Activity For Booking In Application
INRidetells Maps that it must launch your app to complete the booking.
Listing 1 shows the creation of an
INRide object for a compact car with fixed pricing options. In this case, the ride-booking service computes the price of the ride and quotes it directly. Because the ride’s price and number of passengers can’t change, it includes a disclaimer message to convey the vehicle capacity rather than assigning a value to the
Listing 2 shows another example of how to create an
INRide, in this case for an SUV type of vehicle. In this case, there are three separate pricing tiers according to the number of passengers. Each tier requires a separate
INRide object to include the pricing and information about the number of passengers. The ride option also fills in the
price property based on the prices of the different configurations.
Figure 1 shows how Maps reveals the party size details to the user. When selecting a vehicle, Maps displays the base price range initially. When the user actually requests the vehicle, Maps prompts the user to select the number of passengers. Base the information for each price tier on the information you supply in the