We will use the user’s GPS position as the start location, the user will be prompted to enter the destination as seen next:
2. Deep linking data
2.1 Deep linking passenger data
In the booking flow, the user will be required to enter the passenger information. If you already know this data you can deep link it to us and we’ll pre-fill those fields:
In the booking flow, user will be required to enter the start and end locations of the ride. If you already know this data you can deep link it to us and we’ll pre-fill those fields.
For example, let’s say that the user just purchased a flight ticket that departs from San Francisco Airport and you want to offer to book a ride there. This is how you’d deep link that search:
User will be taken directly to search results as seen next:
You will notice that the googleId and address fields are optional and you can pass nil to them. We recommend providing this data if you already have it to get more accurate results.
The googleId field corresponds to Google’s unique identifier for places (PlaceID), you can read more about it here.
2.3 Deep linking pickup time search data
In the booking flow, user can either search for rides at the current time or in advance for a date in the future. This information is editable through the app, but if you already know the date for which the user will be interested in booking a ride, you can deep link it to us. To do so, you need to specify a pickupTime on the MozioSearchData.
There are three ways of building a MozioSearchPickupTime:
Using the leaveNow() method, which will configure the search for the moment of the booking. This is the default behavior if no pickupTime is set.
Using the specificDate(date: Date) method, which will configure the search for the given date.
Using the roundTrip(outboundDate: Date, returnDate: Date) method, which will configure the search for a round trip considering the two dates. Note that the outboundDate must precede the returnDate. If given dates do not represent a valid time segment in the future, return value will be MozioSearchPickupTime.leaveNow(), the user will then have to manually enter outbound and return dates.
The specific Date doesn’t consider time zones, and Mozio will return results for the time sent at the time zone of the location used. Every app handles dateTimes on a different way, so let’s go through a couple of examples detailing how to build the Date object depending on your situation.
From time interval
If you want the search to throw results, for example, in a week:
From timestamp without timezone
If your app deals with String timestamps that don’t include a timezone, you can just use a DateFormatter to extract the Date object from it.
From timestamp with timezone
If your app deals with String timestamps that include a timezone, the easiest way is removing the timezone indication from the String before parsing it as a Date.
When you don’t specify a currency, all prices are displayed in USD.
2.5 Deep linking booking features
You can specify which features should the user have available on the SDK when booking a ride. Such specifications can be done on the MozioBookingFeatures object, which has the following attributes (all enabled by default).
futureBookingEnabled: defines if user will be able to book rides on a specific future date.
leaveNowEnabled: defines if user will be able to book rides for the time of the search (Leave now).
storingCardsEnabled: defines if user will be able to store his credit/debit card information on Mozio’s session.
Mozio strongly recommends leaving every feature enabled. These should only be disabled in case there is an explicit requirement to disable one of them.
At least one of futureBookingEnabled or leaveNowEnabled must be enabled. If your app invokes the booking flow with both features disabled, the call will be ignored and no screen will be presented to the user.
Mozio will never store card information without user’s consent. The fact that storingCardsEnabled is set to true doesn’t mean that Mozio will keep the card data by default: user will still need to approve such behavior when entering the card details.
2.6 Deep linking payment data
Your app will probably keep payment information about the users (credit and debit cards). If desired, this information can be deep linked to Mozio so that users can use the same cards for the booking of rides. The explanation of such feature can be found at our Deep linking payment data guide.
2.7 Deep linking extra data
You can specify extra data to be linked with the reservation as follows:
Passed data through this method will be available in the reports sent each month via email.
3. Further reading
There are other topics you will need to cover, like adding Tracking status to your UI and using the Staging environment to test the booking flow.
Full details in our Advanced guide.