CarPlayManagerDelegate

CarPlayManagerDelegate is the main integration point for Mapbox CarPlay support.

Implement this protocol and assign an instance to the delegate property of the shared instance of CarPlayManager.

If no delegate is set, a default built-in MapboxNavigationService will be created and used when a trip begins.

  • Offers the delegate an opportunity to provide a customized list of leading bar buttons at the root of the template stack for the given activity.

    These buttons’ tap handlers encapsulate the action to be taken, so it is up to the developer to ensure the hierarchy of templates is adequately navigable.

    Default Implementation

  • Offers the delegate an opportunity to provide a customized list of trailing bar buttons at the root of the template stack for the given activity.

    These buttons’ tap handlers encapsulate the action to be taken, so it is up to the developer to ensure the hierarchy of templates is adequately navigable.

    Note

    This delegate method includes a default implementation that prints a warning to the console when this method is called. See UnimplementedLogging for details.

    Default Implementation

  • Offers the delegate an opportunity to provide a customized list of buttons displayed on the map.

    These buttons handle the gestures on the map view, so it is up to the developer to ensure the map template is interactive. If this method is not implemented, or if nil is returned, a default set of zoom and pan buttons declared in the CarPlayMapViewController will be provided.

    Note

    This delegate method includes a default implementation that prints a warning to the console when this method is called. See UnimplementedLogging for details.

    Default Implementation

  • Asks the delegate to provide a navigation service. In multi-screen applications this should be the same instance used to guide the user along the route on the phone.

    Note

    This delegate method includes a default implementation that prints a warning to the console when this method is called. See UnimplementedLogging for details.
  • Offers the delegate an opportunity to react to updates in the search text.

    Note

    This delegate method includes a default implementation that prints a warning to the console when this method is called. See UnimplementedLogging for details.

    Postcondition

    You must call completionHandler within this method.

    Default Implementation

  • Offers the delegate an opportunity to react to selection of a search result.

    Note

    This delegate method includes a default implementation that prints a warning to the console when this method is called. See UnimplementedLogging for details.

    Postcondition

    You must call completionHandler within this method.

    Default Implementation

  • Called when the CarPlay manager fails to fetch a route.

    Note

    This delegate method includes a default implementation that prints a warning to the console when this method is called. See UnimplementedLogging for details.

    Default Implementation

  • carPlayManager(_:willPreview:) Default implementation

    Offers the delegate the opportunity to customize a trip before it is presented to the user to preview.

    To customize the destination’s title, which is displayed when a route is selected, set the MKMapItem.name property of the CPTrip.destination property. To add a subtitle, create a new MKMapItem whose MKPlacemark has the Street key in its address dictionary.

    Note

    This delegate method includes a default implementation that prints a warning to the console when this method is called. See UnimplementedLogging for details.

    Default Implementation

  • carPlayManager(_:willPreview:with:) Default implementation

    Offers the delegate the opportunity to customize a trip preview text configuration for a given trip.

    Note

    This delegate method includes a default implementation that prints a warning to the console when this method is called. See UnimplementedLogging for details.

    Default Implementation

  • Offers the delegate the opportunity to react to selection of a trip. Certain trips may have alternate route(s).

    Note

    This delegate method includes a default implementation that prints a warning to the console when this method is called. See UnimplementedLogging for details.

    Default Implementation

  • Called when navigation begins so that the containing app can update accordingly.

    Note

    This delegate method includes a default implementation that prints a warning to the console when this method is called. See UnimplementedLogging for details.

    Default Implementation

  • carPlayManagerDidEndNavigation(_:) Default implementation

    Called when navigation ends so that the containing app can update accordingly.

    Note

    This delegate method includes a default implementation that prints a warning to the console when this method is called. See UnimplementedLogging for details.

    Default Implementation

  • Called when the carplay manager will disable the idle timer.

    Implementing this method will allow developers to change whether idle timer is disabled when carplay is connected and the vice-versa when disconnected.

    Note

    This delegate method includes a default implementation that prints a warning to the console when this method is called. See UnimplementedLogging for details.

    Default Implementation