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
- Authentication: API key, JSON Web Token (JWT)
- Also enable: Maps SDK for iOS
- Get started: Set up Driver SDK for iOS
- Reference: Driver SDK for iOS reference
- Policies: Driver SDK for iOS policies
- Release notes: Driver SDK for iOS release notes
Official Driver SDK for iOS packages:
- cocoapods:
GoogleRidesharingDriver - swift_package:
https://github.com/googlemaps/ios-driver-sdk
Driver SDK for iOS: related products
- Often used with: Navigation SDK for iOS, Fleet Engine Service, Consumer SDK for iOS
Driver SDK for iOS: common mistakes
- Problem: The first vehicle update after startup can fail with 'update_mask cannot be empty' when the
updateMaskparameter is empty. Fix: Always provide at least one field name inupdateMask, and handle this error inGMTDVehicleReporterListenerdidFailVehicleUpdate. See /maps/documentation/mobility/driver-sdk/on-demand/ios/troubleshoot. - Problem:
GMSRoadSnappedLocationProviderdoesn'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 startGMSRoadSnappedLocationProvider(withGMTDVehicleReporteralready 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 tosetDestinations()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
GMTSVehicleMatchclass: 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.GMTSServiceTypeandfetchAuthTokenForServiceType:authorizationContext:completion:: Deprecated since 2021-11-29. Replacement:GMTDAuthorizationfetchTokenWithContext:completion:withGMTDAuthorizationContext(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.
- Report a vehicle's real-time position to the Fleet Engine service.
- Report the latitude/longitude coordinates of a vehicle's trip waypoints from the Navigation SDK to the Fleet Engine service.
- Report a vehicle's remaining distance to its next waypoint to the Fleet Engine service.
- Report a vehicle's estimated time of arrival at its next waypoint to the Fleet Engine service.
- Report the route provided for a vehicle by the Navigation SDK to the Fleet Engine service.