Handle mid-trip app switching

A driver might switch back to your app mid-trip to view order details or contact the customer. To support app switching without confusing the driver or triggering double billing, implement the following updates:

  • Update your app UI: An ENROUTE payload status indicates that the driver is on an active trip. To reflect this, change your routing button text from "Start" to "Resume".

  • Reuse the trip token: To return the driver to the active route, don't create a new Navigation Connect session. Creating a new session can confuse the driver and cause potential double billing. Instead, provide the same trip token to continue the already-started session. Relaunch Google Maps or Waze based on the driver's device platform:

    • Android (Google Maps and Waze): Use PackageManager.getLaunchIntentForPackage() to bring Google Maps or Waze back to the foreground. To ensure the driver can switch back and forth, verify that you successfully passed the PendingIntent using the exact extra key "pendingIntent" when you initially launched the app.

    • iOS (Waze only): Reopen the original Waze deep link. You don't need to add additional code to enable the return button, as Waze automatically uses the Universal Link you supplied during setup.