Skip to content

Frontend integration

General information

To use the functionality of watchdog search in the ride hailing (RH) operator native mobile app, Mileus provides frontend integration with a partly customized UI (icons and colors).

The RH app can put a button for watchdog search screen opening anywhere, it can be placed for example in a separate menu item or incorporated into the standard order flow.

There are two ways of invoking the Mileus SDK screens, the app can open the watchdog screen (described below) or also the scheduling screen (described in the Scheduling section). It is also possible to access the scheduling screen from the UI of the watchdog screen, so the watchdog screen should be considered the "default" screen to be opened.

There is also a pre-launch market validation functionality available, it supports example route searches and user poll in order for the RH operator to assess the potential user engagement once the full watchdog functionality is launched.

Watchdog state

Once open, the watchdog search screen displays the current state (sub-screen) for the given user, so the screen (and even app) can be closed and then re-opened to come back to where the user left off. This is based on the accessToken retrieved via the Watchdog auth API), the state is synchronized and updated via backend connection so the device needs to be connected to the internet in order to use watchdog functionality.

Please note that the watchdog screen state is tied to a specific RH app user, if the same user opens watchdog on a different device they'll see the same state (provided that both devices are online). For the description of the different states (sub-screens) in the watchdog search screen, see the UI screens section.

User interaction

Any backend actions triggered by the user's interaction with the watchdog screen (like starting the search or booking a taxi) are handled by the Watchdog SDK and Mileus backend, so there are no requirements for the RH app to perform any backend calls (with the exception of Watchdog auth API for token retrieval).

The RH app needs to provide and implement callbacks in order to allow the user to interact with the watchdog screen in a comfortable way, for example change the origin and destination or open the native taxi screen.

Push notifications

While the watchdog search is in progress, the user is free to close the screen or the whole app instead of waiting for updates. When there is an update detected, Mileus backend uses the Notification API to instruct the RH system to send a push notification to the specific user.

The RH app needs to make sure that upon clicking the notification, the user is taken to the watchdog screen (which will then show the updated state).

Mobile SDKs

The RH operator can integrate the watchdog search functionality into their native mobile app using one of the two Mileus watchdog mobile SDKs:

The SDKs contain the full functionality including UI and communication with backend, the RH app just needs to provide initialisation data and some callbacks to handle switches to native screens (see the SDK docs for details).

SDK initialisation

The first step is to retrieve the accessToken via the Watchdog auth API, this token then has to be provided to the SDK. There are also partnerName and environment parameters, these will be specified during the integration project.

To open the Mileus screen, the RH app needs to provide the origin and destination to the SDK. Depending on the type of integration, the RH app chooses to open one of the SDK screens:

  • Market validation integration - startMarketValidationActivity on Android and MileusMarketValidation on iOS
  • Watchdog search integration - startWatchdogActivity or startWatchdogSchedulingActivity on Android and MileusWatchdogSearch or MileusWatchdogScheduler on iOS

SDK callbacks

If the RH operator implements the full Watchdog search integration, there are several callbacks that need to be provided and implemented by the RH app in order for the watchdog search to function properly, they can be split into two main (platform non-specific) groups according to their purpose:

  • Location change - Callbacks used to invoke a screen in the native app which handles the change of origin, destination or home, relevant to the Start and Scheduling screens
  • Taxi screen - Callbacks used to invoke the native taxi ride screen which the user usually sees when a ride/order is in progress, relevant to the PT Ride and Taxi Ride screens

Please keep in mind that when the user opens the native taxi screen from the PT Ride screen to check the details of the pickup, it's recommended for the RH app to provide a way for the user to get back to the watchdog search screen, otherwise the user would need to find the watchdog search section through the menu again.

Please see the Android and iOS docs for the specific callbacks description.