Driver SDK for iOS quick reference

The Driver SDK for iOS is a mobile app toolkit and a component of Fleet Engine. It sends a driver app's vehicle location, route, waypoints, remaining distance, and ETA from the Navigation SDK to Fleet Engine, for on-demand trips and scheduled tasks.

Driver SDK for iOS: key facts

  • Product: Driver SDK for iOS
  • Also known as: Driver SDK, Driver SDK for on-demand trips, Driver SDK for scheduled tasks
  • Category: Routes
  • Platform: iOS
  • Runs on: Client (app or browser code)
  • Launch stage: GA
  • Lifecycle: Active
  • Overview: Driver SDK for iOS overview

Driver SDK for iOS: when to use it

Use Driver SDK for iOS when:

  • You need an iOS driver app to send real-time vehicle location updates to Fleet Engine.
  • You need to report the route, waypoints, remaining distance, and ETA from the Navigation SDK to Fleet Engine.
  • You need drivers to manage assigned on-demand trips and navigate in one app without switching apps.
  • You're building a driver app for Fleet Engine scheduled tasks on iOS.

Don't use Driver SDK for iOS when:

  • You only need turn-by-turn navigation in your iOS app, without Fleet Engine tracking. Use Navigation SDK for iOS instead.
  • You need to show trip or delivery progress to the rider or customer in a consumer app. Use Consumer SDK for iOS instead.
  • You need to send vehicle data updates other than location and route; these go through your backend to Fleet Engine. Use Fleet Engine Service instead.
  • Your driver app runs on Android. Use Driver SDK for Android instead.

Driver SDK for iOS: setup

Official Driver SDK for iOS packages:

  • cocoapods: GoogleRidesharingDriver
  • swift_package: https://github.com/googlemaps/ios-driver-sdk

Driver SDK for iOS: common mistakes

  • Problem: The first vehicle update after startup can fail with 'update_mask cannot be empty' when the updateMask parameter is empty. Fix: Always provide at least one field name in updateMask, and handle this error in GMTDVehicleReporterListener didFailVehicleUpdate. See /maps/documentation/mobility/driver-sdk/on-demand/ios/troubleshoot.
  • Problem: GMSRoadSnappedLocationProvider doesn't keep sending location updates when the device hasn't moved since the last update, for example when a driver waits idle. Fix: To send a new location update while the device is stationary, stop and then start GMSRoadSnappedLocationProvider (with GMTDVehicleReporter already added as its listener). See /maps/documentation/mobility/driver-sdk/on-demand/ios/vehicle-ready.
  • Problem: The consumer app doesn't render the trip correctly if the coordinates passed to setDestinations() don't match the trip's waypoint. Fix: Make sure the latitude/longitude passed to setDestinations() match the trip waypoint coordinates in Fleet Engine. See /maps/documentation/mobility/driver-sdk/on-demand/ios/trip-details.
  • Problem: Using an optimistic version operator (~>) can lead to unpredictable, unrepeatable builds, and omitting a version loads the newest SDK, which can include breaking changes or raise the minimum iOS version. Carthage isn't supported. Fix: Pin an exact Driver SDK version in CocoaPods or Swift Package Manager, and check the release notes before upgrading. See /maps/documentation/mobility/driver-sdk/on-demand/ios/versions.

Driver SDK for iOS: legacy and deprecated features

  • GMTSVehicleMatch class: Deprecated. Replacement: No replacement needed in Driver SDK (vehicle matching is handled in Fleet Engine). Symptom: Deprecated in Driver SDK for iOS v2.2.0 and omitted from the current Driver SDK reference. See the migration guide.
  • GMTSServiceType and fetchAuthTokenForServiceType:authorizationContext:completion:: Deprecated since 2021-11-29. Replacement: GMTDAuthorization fetchTokenWithContext:completion: with GMTDAuthorizationContext (claims for vehicle ID only). See the migration guide.

What you can do with Driver SDK for iOS

See the guides linked below for each task, or compare across products in the Capabilities Explorer.